Bug 24970 - Error in header file: ctime:69: error: ‘::tm’ has not been declared
Summary: Error in header file: ctime:69: error: ‘::tm’ has not been declared
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-21 13:59 UTC by Erik Schnetter
Modified: 2005-11-21 20:53 UTC (History)
1 user (show)

See Also:
Host: powerpc-apple-darwin8.3.0
Target: powerpc-apple-darwin8.3.0
Build: powerpc-apple-darwin8.3.0
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Failing source code (17.22 KB, text/plain)
2005-11-21 14:01 UTC, Erik Schnetter
Details
Failing preprocessed sourc code (gzipped) (154.51 KB, application/octet-stream)
2005-11-21 14:03 UTC, Erik Schnetter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Schnetter 2005-11-21 13:59:44 UTC
When trying to compile the attached source file with

$ ~/gcc/bin/g++ --version
g++ (GCC) 4.2.0 20051121 (experimental)

with the options

/Users/eschnett/gcc/bin/g++ -DCARPET_INT -DCARPET_REAL -DCARPET_COMPLEX -mlongcall -ftrapv -fwrapv -fbounds-check -g3 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Woverloaded-virtual -c -o $current_wd/patch_system.cc.o $current_wd/patch_system.cc -I"/sw/include" -I"/sw/include" -I"/Users/eschnett/petsc-2.1.6/include" -I"/Users/eschnett/petsc-2.1.6/bmake/macx" -I"/Users/eschnett/Cvanilla/arrangements/AEIThorns/AHFinderDirect/src" -I"/Users/eschnett/Cvanilla/arrangements/AEIThorns/AHFinderDirect/src/include" -I"/Users/eschnett/Cvanilla/configs/einstein-orange-gcc-debug/config-data" -I"/Users/eschnett/Cvanilla/configs/einstein-orange-gcc-debug/bindings/include" -I"/Users/eschnett/Cvanilla/src/include" -I"/Users/eschnett/Cvanilla/arrangements" -I"/Users/eschnett/Cvanilla/configs/einstein-orange-gcc-debug/bindings/Configuration/Thorns" -I"/Users/eschnett/Cvanilla/arrangements/AEIThorns/AHFinderDirect/src/patch" -I"/Users/eschnett/Cvanilla/arrangements/AEIThorns/AHFinderDirect/src/patch/include" -DTHORN_IS_AHFinderDirect -DCCODE

then I receive errors beginning with

/Users/eschnett/gcc/lib/gcc/powerpc-apple-darwin8.3.0/4.2.0/../../../../include/c++/4.2.0/ctime:69: error: ‘::tm’ has not been declared
/Users/eschnett/gcc/lib/gcc/powerpc-apple-darwin8.3.0/4.2.0/../../../../include/c++/4.2.0/ctime:71: error: ‘::clock’ has not been declared
/Users/eschnett/gcc/lib/gcc/powerpc-apple-darwin8.3.0/4.2.0/../../../../include/c++/4.2.0/ctime:72: error: ‘::difftime’ has not been declared
Comment 1 Erik Schnetter 2005-11-21 14:01:46 UTC
Created attachment 10309 [details]
Failing source code
Comment 2 Erik Schnetter 2005-11-21 14:03:43 UTC
Created attachment 10310 [details]
Failing preprocessed sourc code (gzipped)
Comment 3 Andrew Pinski 2005-11-21 14:55:01 UTC
# 1 "/Users/eschnett/Cvanilla/configs/einstein-orange-gcc-debug/bindings/Configuration/Thorns/time.h" 1 3 4


Hmm, it is including the wrong time.h for some reason.

Could you add -v and provide the output, I am mainly looking for the include patch order.
Comment 4 Andrew Pinski 2005-11-21 15:01:07 UTC
We have in libstdc++:
#include <time.h>

So this is invalid. -I does:
       -I dir
           Add the directory dir to the list of directories to be searched
           for header files.  Directories named by -I are searched before the
           standard system include directories.  If the directory dir is a
           standard system include directory, the option is ignored to ensure
           that the default search order for system directories and the spe-
           cial treatment of system headers are not defeated .

either use -iquote which is new for 4.0.0 or use -idirafter
Comment 5 Andrew Pinski 2005-11-21 15:02:15 UTC
As I said this is invalid.
Comment 6 Erik Schnetter 2005-11-21 20:53:46 UTC
Thanks for finding the reason.

The include file was actually called "Time.h", but my file system is case insensitive.