[Bug gas/10813] New: Compile error: gas/config/tc-arm.c:2489: error: suggest braces around empty body in an ‘if’ statement

View: New views
4 Messages — Rating Filter:   Alert me  

[Bug gas/10813] New: Compile error: gas/config/tc-arm.c:2489: error: suggest braces around empty body in an ‘if’ statement

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I have a compile error that is probably quite easy to fix if you know the code.
The compiler suggests braces around empty body in an ‘if’ statement,
and that would be this code.

  if (frag->tc_frag_data.last_map != NULL)
    know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP));
  frag->tc_frag_data.last_map = symbolP;

Are the missing {} supposed to include the second line as well or only the first
line?

How to reproduce:
wget http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.bz2
tar -xvjf binutils-2.20.tar.bz2
cd binutils-2.20
mkdir build
cd build
export TOOLPATH=/usr/local/cross-cortex-m3
../configure --target=arm-none-eabi  \
             --prefix=$TOOLPATH  \
             --enable-interwork  \
             --enable-multilib  \
             --with-gnu-as  \
             --with-gnu-ld  \
             --disable-nls
make -j4


Thanks
Johan

--
           Summary: Compile error: gas/config/tc-arm.c:2489: error: suggest
                    braces around empty body in an ‘if’ statement
           Product: binutils
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: bugs at fun-tech dot se
                CC: bug-binutils at gnu dot org
  GCC host triplet: Ubuntu 9.10 AMD64
GCC target triplet: Cortex M3 (STM32)


http://sourceware.org/bugzilla/show_bug.cgi?id=10813

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gas/10813] Compile error: gas/config/tc-arm.c:2489: error: suggest braces around empty body in an ‘if’ statement

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From bugs at fun-tech dot se  2009-10-20 08:34 -------
And the compiler output

make[4]: Entering directory `/home/cj/STM32/gcc-toolchain/binutils-2.20/build/gas'
gcc -DHAVE_CONFIG_H -I. -I../../gas  -I. -I../../gas -I../bfd -I../../gas/config
-I../../gas/../include -I../../gas/.. -I../../gas/../bfd
-DLOCALEDIR="\"/usr/local/cross-cortex-m3/share/locale\""  -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT tc-arm.o -MD -MP -MF
.deps/tc-arm.Tpo -c -o tc-arm.o `test -f 'config/tc-arm.c' || echo
'../../gas/'`config/tc-arm.c
gcc -DHAVE_CONFIG_H -I. -I../../gas  -I. -I../../gas -I../bfd -I../../gas/config
-I../../gas/../include -I../../gas/.. -I../../gas/../bfd
-DLOCALEDIR="\"/usr/local/cross-cortex-m3/share/locale\""  -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT atof-ieee.o -MD -MP
-MF .deps/atof-ieee.Tpo -c -o atof-ieee.o `test -f 'config/atof-ieee.c' || echo
'../../gas/'`config/atof-ieee.c
make[4]: Entering directory `/home/cj/STM32/gcc-toolchain/binutils-2.20/build/ld'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/home/cj/STM32/gcc-toolchain/binutils-2.20/build/ld'
make[3]: Leaving directory `/home/cj/STM32/gcc-toolchain/binutils-2.20/build/ld'
make[2]: Leaving directory `/home/cj/STM32/gcc-toolchain/binutils-2.20/build/ld'
cc1: warnings being treated as errors
../../gas/config/tc-arm.c: In function ‘make_mapping_symbol’:
../../gas/config/tc-arm.c:2489: error: suggest braces around empty body in an
‘if’ statement
mv -f .deps/atof-ieee.Tpo .deps/atof-ieee.Po
make[4]: *** [tc-arm.o] Error 1


--


http://sourceware.org/bugzilla/show_bug.cgi?id=10813

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gas/10813] Compile error: gas/config/tc-arm.c:2489: error: suggest braces around empty body in an ‘if’ statement

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From gingold at adacore dot com  2009-10-20 08:39 -------
Hello,

yes this is a known issue, that has already been fixed in the branch.
As a work-around, use --disable-werror when configuring.

Tristan.


--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=10813

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gas/10813] Compile error: gas/config/tc-arm.c:2489: error: suggest braces around empty body in an ‘if’ statement

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From bugs at fun-tech dot se  2009-10-20 08:57 -------
Thanks

--


http://sourceware.org/bugzilla/show_bug.cgi?id=10813

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils