We have simple source file: file.64.cpp
int main()
{
#ifdef SOME64
printf("64\r\n");
#else
printf("32\r\n");
#endif
return 0;
}

So. If we build file with that command
$CC -DSOME64 -I../../common/src -O0 -g3 -Wall -c "systemcontroller.64.cpp"
then SOME64 are undefined in file(../../common/src is valid path).
if we erase include block(-I) or write invalid path like this
$CC -DSOME64 -I../../common/src_1 -O0 -g3 -Wall -c "systemcontroller.64.cpp"
than everithing work fine... i mean SOME64 are defined in file.

$CC can be g++, gcc, cc, c++.

os: Bluewhite64-current
gcc-config:
Reading specs from /usr/lib/gcc/x86_64-pc-linux/4.3.3/specs
Target: x86_64-pc-linux
Configured with: ../gcc-4.3.3/configure --prefix=/usr --libdir=/usr/lib
--enable-shared --enable-bootstrap
--enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix
--enable-checking=release --with-system-zlib --disable-libunwind-exceptions
--enable-__cxa_atexit --enable-libssp --with-gnu-ld --verbose
--disable-multilib --target=x86_64-pc-linux --build=x86_64-pc-linux
--host=x86_64-pc-linux
Thread model: posix
gcc version 4.3.3 (GCC)


-- 
           Summary: Command-line defines(-D) are not working with include(-
                    I)
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: smal dot root at gmail dot com
 GCC build triplet: x86_64
  GCC host triplet: x86_64
GCC target triplet: x86_64


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

Reply via email to