This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [RFA/C] Break out C options into a separate file


 > I've applied this.
 > Neil.
 > 	* opts.sh: Remove path from sort.

Neil, I'm having lots of problems with your new code.  Issues 3 & 4
lead me to assume you checked in the wrong version of the patch and/or
got something confused when testing it cause I don't see how it could
have possibly worked.  So far here are the problems I've encountered.

1.  Generating c-options.[ch] is not parallel-make safe.  The way the
    Makefile rule is written, if run e.g. make -j10 I get two
    invocations of opts.sh, one for c-options.c and one for
    c-options.h and they clobber each other since the opts.sh script
    writes out both files in one pass.

2.  So I ran it serially, opts.sh seems to use some gawk-specific
    features (or at least my solaris2 awk can't handle it.  (Maybe it
    requires nawk?)

awk: syntax error near line 5
awk: illegal statement near line 5
awk: syntax error near line 2
awk: bailing out near line 2
make: *** [c-options.c] Error 2


3.  When I substitute gawk the script runs.  However the resulting
    c-options.[ch] files cannot be compiled.  c-options.c doesn't
    include c-options.h so it doesn't know about the cl_options
    struct.

c-options.c:3: warning: array type has incomplete element type
c-options.c:3: error: elements of array `cl_options' have incomplete type

4.  If I hack opts.sh to insert #include "c-options.h" in c-options.c,
    then I get another error.  The CL_* stuff are macros defined in
    c-opts.c, but not in c-options.[ch].  They need to be in a header:

c-options.c:7: error: `CL_C' undeclared here (not in a function)
c-options.c:7: error: `CL_OBJC' undeclared here (not in a function)
c-options.c:7: error: `CL_CXX' undeclared here (not in a function)
c-options.c:7: error: `CL_OBJCXX' undeclared here (not in a function)


At this point I gave up.  Would you please take a look and ensure
everything works correctly?

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


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