GNOME Bugzilla – Bug 536044
Compilation fails with "unexpected $undefined"
Last modified: 2008-08-17 00:56:26 UTC
Like this: (rm -f corba-defs.h corba-defs-stubs.c corba-defs-skels.c corba-defs-common.c corba-defs-imodule.c corba-defs-skelimpl.c || true) > /dev/null ../../../src/idl-compiler/orbit-idl-2 -I../../../src/idl/CORBA_PIDL -I../../../src/idl/CORBA -I../../../src/idl/interop -I../../../src/orb/orb-core --noskels --nodefskels --nostubs --noidata --nocommon --showcpperrors --define=Object=OObject --define=TypeCode=TTypeCode --deps ./.deps/corba-defs.idl.P ../../../src/orb/orb-core/corba-defs.idl orbit-idl-2 2.14.13 compiling mode, show preprocessor errors, passes: headers Processing file ../../../src/orb/orb-core/corba-defs.idl ../../../src/orb/orb-core/corba-defs.idl:20: Error: syntax error, unexpected $undefined ** (orbit-idl-2:15777): WARNING **: ../../../src/orb/orb-core/corba-defs.idl compilation failed make[8]: *** [corba-defs.h] Fel 1
This maybe is a problem in libIDL and not in ORBit2. The following test code will print "OK!" when linked to libIDL 0.8.9 shipped with Ubuntu Gutsy: #include <libIDL/IDL.h> int main (int argc, char *argv) { IDL_ns ns; IDL_tree tree; int errcode = IDL_parse_filename ("test.idl", "", NULL, &tree, &ns, 0, 4); switch (errcode) { case IDL_SUCCESS: printf ("OK!\n"); break; case IDL_ERROR: printf ("IDL Error\n"); break; default: printf ("Other error: %d\n", errcode); } } test.idl: module Arg { const long MOO = 1; }; when linked against libIDL 0.8.11 from svn it prints: test.idl:4: Error: syntax error, unexpected $undefined IDL Error
CCing tml, since he committed to both ORBit and libIDL recently. Also relevant might be these build failures in ORBit2 from the autobuilders: works: http://jhbuild.bxlug.be/builds/2008-05-20-0001/ fails: http://jhbuild.bxlug.be/builds/2008-05-21-0001/
ORBit2 still doesn't build...
Turns out this problem was my own damn fault although the exact problem is unbelievably strange. The test program worked with the tarball for libIDL 0.8.1 but not for libIDL 0.8.2. The only important difference between those versions is that 0.8.1's configure script was generated using Autoconf 2.53 and 0.8.2's using Autoconf 2.57. For some reason, using the newer autoconf sets the CPP_NOSTDINC macro to '-I-' instead of '' on my system. That macro is used in IDL_parse_filename in util.c to build a string to send to the C preprocessor. Substituted with the filename of the IDL file it becomes: gcc -E -I- - -I. < "test.idl" 2>/dev/null And running that on a fairly recent gcc outputs: cc1: note: obsolete option -I- used, please use -iquote instead Except that that is printed on stderr and is redirected to /dev/null. Well that would have happened, unless you are using a wrapper script around gcc which redirects stderr to stdout to help grc colorize gcc's error messages. :) The parser generated by flex barfs on that line with an even more arcane error: test.idl:4: Error: syntax error, unexpected $undefined So there is no bug here. On the other hand, the code that checks and sets CPP_NOSTDINC seem to be completely pointless.