This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ bug (?) with latest snapshot.


Hello,

'cc1plus' doesn't permit matching external declarations inside function. Here
is an example:

osv@osv$ cat extern.cc
void foo(void)
{
  extern int i;
  extern int i;
}
osv@osv$ ~/local/bin/ppc-rtems-gcc -v -c extern.cc
Reading specs from /home/osv/local/lib/gcc-lib/ppc-rtems/2.96/specs
gcc version 2.96 20000320 (experimental)
 /home/osv/local/lib/gcc-lib/ppc-rtems/2.96/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__cplusplus -DPPC -Drtems -D__rtems__ -D__PPC__ -D__rtems__ -D__rtems__ -D__PPC -D__rtems -Asystem(rtems) -Acpu(powerpc) -Amachine(powerpc) -D__EXCEPTIONS -D__CHAR_UNSIGNED__ -D_CALL_SYSV -D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine(bigendian) -D_ARCH_PPC extern.cc /tmp/ccP02LRb.ii
GNU CPP version 2.96 20000320 (experimental) (cpplib)
 (PowerPC Embedded)
ignoring nonexistent directory `/home/osv/local/ppc-rtems/sys-include'
#include "..." search starts here:
#include <...> search starts here:
 /home/osv/local/include/g++-
 /home/osv/local/lib/gcc-lib/ppc-rtems/2.96/include
 /home/osv/local/ppc-rtems/include
End of search list.
 /home/osv/local/lib/gcc-lib/ppc-rtems/2.96/cc1plus /tmp/ccP02LRb.ii -quiet -dumpbase extern.cc -version -o /tmp/cc24bh9l.s
GNU C++ version 2.96 20000320 (experimental) (ppc-rtems) compiled by GNU C version 2.95.2 20000220 (Debian GNU/Linux).
extern.cc: In function `void foo ()':
extern.cc:4: declaration of `int i'
extern.cc:3: conflicts with previous declaration `int i'
osv@osv$

BR,
Sergei Organov.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]