|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Bug in warningsCompiling:
static long bug(void) { long bugged; bugged = 1 << 30; return( bugged ); } Produces: msp430-gcc -mmcu=msp430x1611 -pipe -O2 -mendup-at=main -g -minline-hwmul -fno- defer-pop -I ../include -I ../proc1 -Wall -W -Wcast-align -Wcast-qual - Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith - Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch -Wunused -Wwrite-strings -Winline -c -o bug.o bug.c bug.c: In function `bug': bug.c:5: warning: left shift count >= width of type Using: > msp430-gcc --version msp430-gcc (GCC) 3.2.3 compiled from CVS using the makefile in "packaging", as advised in the documentation. -- Rick Jenkins <rick@...> Hartman Technica http://www.hartmantech.com Phone +1 (403) 230-1987 221 35 Avenue. N.E., Calgary, Alberta, Canada T2E 2K5 ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Mspgcc-users mailing list Mspgcc-users@... https://lists.sourceforge.net/lists/listinfo/mspgcc-users |
|
|
Re: Bug in warningsWhy is that a bug? your numbers are ints it does an int calculation an
then extends the result to store it/ return it (the rules when C does implicit casts are not always intuitive :/ ) if you want to force the compiler to use a different number type than int (which is 16 bits for the MSP430) you could write 1L << 30 chris Rick Jenkins schrieb: > Compiling: > > static long bug(void) > { > long bugged; > > bugged = 1 << 30; > return( bugged ); > } > > Produces: > > msp430-gcc -mmcu=msp430x1611 -pipe -O2 -mendup-at=main -g -minline-hwmul -fno- > defer-pop -I ../include -I ../proc1 -Wall -W -Wcast-align -Wcast-qual - > Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith - > Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch -Wunused > -Wwrite-strings -Winline -c -o bug.o bug.c > bug.c: In function `bug': > bug.c:5: warning: left shift count >= width of type > > Using: >> msp430-gcc --version > msp430-gcc (GCC) 3.2.3 > > compiled from CVS using the makefile in "packaging", as advised in the > documentation. > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Mspgcc-users mailing list Mspgcc-users@... https://lists.sourceforge.net/lists/listinfo/mspgcc-users |
|
|
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |