On Thu, Nov 07, 2013 at 09:52:19PM +0100, Joerg Mayer wrote:
> On Thu, Nov 07, 2013 at 08:14:20PM +0000, darkjames@xxxxxxxxxxxxx wrote:
> > http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=53146
> >
> > User: darkjames
> > Date: 2013/11/07 08:14 PM
> >
> > Log:
> > Add infrastructure for section-initializing protocol hfis (without array).
>
> Nice!
>
> > configure implementation later.
>
> Why make this a configure option instead of just setting it?
I'd love to say it works on every platform, but unfortunetly it's not true even on Linux.
I was thinking to run program like: http://www.wireshark.org/~darkjames/section-test.c during ./configure
Tests done on amd64
gcc-4.6.4 (fail):
#v+
$ ./a.out
0x601080
0x601128
-1431655763 ; WTF?!
records: -1431655763 2
#v-
clang-3.3 (ok):
#v+
$ ./a.out
0x602148
0x6021d8
2
records: 2 2
[0] 0x602148 0x602148!
[1] 0x602190 0x602190!
records: 3
[0] 0x602070: String value json.value.string
[0] 0x6020b8: Number value json.value.number
[0] 0x602100: Member json.member
test ok
#v-
To be honest this is my first time where I run some serious testing.
Earlier I've done tests mostly using clang, and sample program from http://stackoverflow.com/q/3808053 (which works also on GCC).
My fault.
btw. this looks like alignment issue, cause if I add some dummy field:
void *same_name_next;
+ char dummy[24];
} header_field_info;
GCC works.
Crazy (why 24?! (8 doesn't work)) not portable stuff.
To be dropped, or need some more reading/ mail to GCC devs.
Cheers,
Jakub