Menu

#12 gcc-4.4 missing include

open-fixed
library (12)
5
2009-05-10
2009-04-29
No

You always have to #include headers directly and cannot
rely for things to be included indirectly.

You can reproduce this problem with gcc-snapshot from unstable or
gcc-4.4 from experimental.

> > Automatic build of jaula_1.4.0-2 on em64t by sbuild/amd64 0.53
...
> > libtool: compile: x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT jaula_lexan.lo -MD -MP -MF .deps/jaula_lexan.Tpo -c jaula_lexan.cc -fPIC -DPIC -o .libs/jaula_lexan.o
> > jaula_lexan.cc: In member function 'int jaulaFlexLexer::yyinput()':
> > jaula_lexan.cc:1505: error: 'EOF' was not declared in this scope
> > make[4]: *** [jaula_lexan.lo] Error 1
> > make[4]: Leaving directory `/build/tbm/jaula-1.4.0/jaula'

The patch below will work. However, since the other #include
statements are wrapped in an #ifdef statement you may want to do this
for this #include too.

--- jaula/jaula_lexan.ll~ 2009-04-29 20:55:20.000000000 +0000
+++ jaula/jaula_lexan.ll 2009-04-29 20:56:24.000000000 +0000
@@ -50,6 +50,8 @@
#endif
}

+#include <cstdio>
+
#ifdef HAVE_SSTREAM
#include <sstream>
#endif

Discussion

  • Kombo Morongo

    Kombo Morongo - 2009-05-10
    • labels: 966276 --> library
    • status: open --> open-fixed
     
  • Kombo Morongo

    Kombo Morongo - 2009-05-10

    Thank you for detecting the bug and the solution proposed.

    Changes are already applied on subversion trunk so it will be automatically included in the next release.

    Meanwhile, users requiring this patch can get sources from subversion repository as explained in https://sourceforge.net/scm/?type=svn&group_id=193555

     

Log in to post a comment.