[Bug c/7652] -Wswitch-break : Warn if a switch case falls through

2012-02-20 Thread eric at brouhaha dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652

Eric Smith  changed:

   What|Removed |Added

 CC||eric at brouhaha dot com

--- Comment #8 from Eric Smith  2012-02-21 01:01:19 
UTC ---
Actually, I would want this warning to occur for all non-empty cases that don't
end in a break or return.  However, I'd also want some means (perhaps a pragma)
to put in the code to suppress the warning for any specific cases that I
actually intend to fall through to the next case.


[Bug c/7652] -Wswitch-break : Warn if a switch case falls through

2012-02-20 Thread eric at brouhaha dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652

--- Comment #9 from Eric Smith  2012-02-21 01:04:18 
UTC ---
Or, instead of a pragma as I proposed in me previous comment, the warning would
be avoided by using a goto to the next case label.  Updated version of the
example from the first comment, which would not trip the warning:

case (foo)
  {
  case 1: case 2:
printf ("case 1 and 2\n");
break;
  case 3: case 4:
printf ("case 3 and case 4\n");
goto 5;
  case 5:
printf ("case 5 (and fallthrough for cases 3 and 4\n");
}


[Bug c/43073] New: building arm cross-compiler fails when attempting to build regex library

2010-02-15 Thread eric at brouhaha dot com
I can bootstrap a cross-compiler with no target system library with GCC 4.3.3,
but using the same configuration options causes a failure when building GCC
4.4.3.  It appears to be attempting to build the regex function of libiberty
for the target, and failing because there isn't a target system library
available.  I'm not sure why 4.4.3 wants to build that when 4.3.3 did not.  My
configuration options are based on what Codesourcery uses for arm-none-eabi in
their 2009q3 toolchain.

Configuration:
../gcc-%{version}/configure \
  --prefix=/usr \
  --mandir=/usr/share/man \
  --infodir=/usr/share/info \
  --target=arm-none-eabi \
  --disable-libmudflap \
  --disable-libssp \
  --disable-libstdcxx-pch \
  --enable-extra-sgxxlite-multilibs \
  --with-gnu-as \
  --with-gnu-ld \
 '--with-specs=%{O2:%{!fno-remove-local-statics: -fremove-local-statics}}
%{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}'
\
  --enable-languages=c \
  --enable-shared \
  --disable-lto \
  --with-newlib \
  --disable-nls \
  --disable-libgomp \
  --without-headers \
  --disable-decimal-float \
  --disable-libffi \
  --with-system-zlib \
  --enable-version-specific-runtime-libs \
  --enable-interwork \
  --enable-poison-system-directories

Failure when building 4.4.3:
checking for a 64-bit type... unsigned long long
checking for pid_t... no
checking for working strncmp... no
updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating config.h
config.status: executing default commands
Adding multilib support to Makefile in ../../../../gcc-4.4.3/libiberty
with_multisubdir=thumb
make[2]: Entering directory
`/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/arm-none-eabi/libiberty'
if [ x"-fPIC" != x ] && [ ! -d pic ]; then \
  mkdir pic; \
else true; fi
touch stamp-picdir
if [ x"-fPIC" != x ]; then \
 
/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/./gcc/xgcc
-B/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/./gcc/
-B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem
/usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include -c
-DHAVE_CONFIG_H -g -O2-I. -I../../../gcc-4.4.3/libiberty/../include  -W
-Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -fPIC
../../../gcc-4.4.3/libiberty/regex.c -o pic/regex.o; \
else true; fi
../../../gcc-4.4.3/libiberty/regex.c:51:25: error: sys/types.h: No such file or
directory
[...lots more errors due to missing sys/types.h omitted here...]
../../../gcc-4.4.3/libiberty/regex.c:8112: warning: incompatible implicit
declaration of built-in function 'free'
../../../gcc-4.4.3/libiberty/regex.c:8121: error: 'regex_t' has no member named
'fastmap_accurate'
make[2]: *** [regex.o] Error 1
make[2]: Leaving directory
`/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/arm-none-eabi/libiberty'
make[1]: *** [all-target-libiberty] Error 2
make[1]: Leaving directory
`/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi'
make: *** [all] Error 2


-- 
   Summary: building arm cross-compiler fails when attempting to
build regex library
   Product: gcc
   Version: 4.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
     Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: eric at brouhaha dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: arm-none-eabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43073