Bryan C. Warnock: # On Sunday 17 March 2002 00:23, Melvin Smith wrote: # > Makes ok, alignment warnings. Tests run ok. Most warnings are # > from -Wpadded. I was able to eliminate 1 or 2 by rearranging # > members in structs, but some are due to unions of different size # > types. # > # > We can either turn off -Wpadded or manually pad the structs # > by changing types or adding placeholders (yucky). This warning # > is typically only useful if you are looking for something specific, # > so unless there is a specific case, I say turn it off. # # I agree.
Agree. # > # > Ditching BOOLVAL in favor of UINTVAL might fix a couple as well. # > Using char types might be a minor memory save, but I'm not sure # > which platforms actually see it due to alignment. # # Until we want to add another one. In either case, UINTVAL is # the wrong # type. We'd want the natural word size, which I haven't # figured out (beyond # benchmarking) how to test for.) # # Leave it as a char, and turn off the warning. Agree. # > # > I cleared up the one warning from io_unix.c. # > # > Follows is a grep -v of the padding warnings leaving other # interesting # > stuff. # > # > packfile.c:123: warning: long int format, unsigned int arg (arg 5) # > jit.c:510: warning: cast increases required alignment of target type # # I *think* I'm stamping those out as soon as 0.0.4 is out. # # > embed.c:121: warning: passing arg 1 of `mem_sys_allocate' # as unsigned due # > to prototype # > embed.c:122: warning: passing arg 3 of `read' as unsigned # due to prototype # > embed.c:149: warning: cast increases required alignment of # target type # # Same as those. # # > misc.c:431: warning: format not a string literal, argument # types not # checked # # Nothing we can do about that. Dumb warning. # > io/io_unix.c:206: warning: comparison of unsigned # expression >= 0 is # always # > true Doesn't hurt to test it. # > encodings/utf32.c:62: warning: cast discards qualifiers # from pointer # target # > type # # Is this solvable? Not unless there's a 'notconst' keyword or something. I've tried getting rid of these, and as far as I can tell it's impossible. If you've got something like void foo(STRING* arg); void bar(const STRING* arg) { foo(arg); } it warns--but it does the same if you do: foo((STRING*)arg); I'd suggest that this be deactivated--I can't see any good coming from it. --Brent Dax <[EMAIL PROTECTED]> @roles=map {"Parrot $_"} qw(embedding regexen Configure) #define private public --Spotted in a C++ program just before a #include