Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 06 May 2013 10:53:57 +0400
From: Alexander Cherepanov <cherepan@...me.ru>
To: john-dev@...ts.openwall.com
Subject: Re: Core: build warning

On 2013-05-06 06:34, Solar Designer wrote:
> On Mon, May 06, 2013 at 05:34:36AM +0400, Alexander Cherepanov wrote:
>> Solar, some other warnings (from -std=c89 -pedantic) you could be
>> interested in:
>
> Thanks!

While you are at it you could also think about fixing undefined behavior
for atoi:

   http://openwall.com/lists/john-dev/2013/04/23/5

[skip]

>> trip_fmt.c: In function ?get_hash_0?:
>> trip_fmt.c:265: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?get_hash_1?:
>> trip_fmt.c:266: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?get_hash_2?:
>> trip_fmt.c:267: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?get_hash_3?:
>> trip_fmt.c:268: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?get_hash_4?:
>> trip_fmt.c:269: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?get_hash_5?:
>> trip_fmt.c:270: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?get_hash_6?:
>> trip_fmt.c:271: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?cmp_one?:
>> trip_fmt.c:512: warning: ISO C90 forbids mixed declarations and code
>> trip_fmt.c: In function ?cmp_exact?:
>> trip_fmt.c:520: warning: ISO C90 forbids mixed declarations and code
>
> I think these are spurious (gcc bug?),

Sorry, forgot to describe the cause for these warnings. After checking 
the result of preprocessing it becomes clear that the problem is in 
extra semicolon in "MAYBE_T0;". It leads to an empty statement after 
macro substitution. Solution is to remove semicolon or to move macro 
after declarations which you just did:

 > but I've now worked around them
 > anyway by swapping the "int ..." and "const int ..." lines.

>> Jim, BTW what do you do with compiler.c when you compile in MS Visual
>> Studio? AFAIK it doesn't support computed gotos. Do you convert it to
>> switch?
>
> compiler.c provides fallback code for non-gcc, with no dependency on
> computed gotos.  It runs 2-3 times slower, though.

Thanks, I see it now.

Except for this file everything now compiles cleanly with the following 
options:

gcc -c -std=c89 -pedantic -Wall -Wextra -Wno-missing-field-initializers 
-Wno-unused-parameter -Wno-sign-compare -Wno-overlength-strings

-- 
Alexander Cherepanov

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.