avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] re: compiler bug?


From: Oleksandr Redchuk
Subject: Re: [avr-gcc-list] re: compiler bug?
Date: Tue, 10 Feb 2009 18:50:20 +0200

2009/2/10 Richard F <address@hidden>:

> Thanks Oleksandr
>
> I reverted to the 3 line full version, all explicit statements to avoid
> confusion.
> FYI The compiler does not produce any warning with -Wall (my default config)

================ foo.c
1: unsigned char ttt;
2:
3: void meow()  {       ttt = ttt < 6 ? ttt++ : 0;      }
4:
5: void baa()   {       ttt = ttt < 6 ? ++ttt : 0;      }
6:
7: void moo()   {       ttt = ttt < 6 ? ttt+1 : 0;      }

================ command line
for /D %p in (20060421,20070525,20071221,20081205) \
  do echo --------- >>tt.txt && \
  c:\WinAVR-%p\bin\avr-gcc --version >>tt.txt 2>&1 && \
  c:\WinAVR-%p\bin\avr-gcc -S -Os -Wall foo.c >>tt.txt 2>&1

================ tt.txt
---------
avr-gcc (GCC) 3.4.6
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

foo.c: In function `meow':
foo.c:3: warning: operation on `ttt' may be undefined
foo.c: In function `baa':
foo.c:5: warning: operation on `ttt' may be undefined
---------
avr-gcc (GCC) 4.1.2 (WinAVR 20070525)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

foo.c: In function 'meow':
foo.c:3: warning: operation on 'ttt' may be undefined
foo.c: In function 'baa':
foo.c:5: warning: operation on 'ttt' may be undefined
---------
avr-gcc (GCC) 4.2.2 (WinAVR 20071221)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

foo.c: In function 'meow':
foo.c:3: warning: operation on 'ttt' may be undefined
foo.c: In function 'baa':
foo.c:5: warning: operation on 'ttt' may be undefined
---------
avr-gcc (WinAVR 20081205) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

foo.c: In function 'meow':
foo.c:3: warning: operation on 'ttt' may be undefined
foo.c: In function 'baa':
foo.c:5: warning: operation on 'ttt' may be undefined


-- 
wbr,
ReAl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]