This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA/C] Break out C options into a separate file
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: neil at daikokuya dot co dot uk
- Cc: gcc-patches at gcc dot gnu dot org, toa at pop dot agri dot ch
- Date: Sun, 1 Jun 2003 11:26:23 -0400 (EDT)
- Subject: Re: [RFA/C] Break out C options into a separate file
- References: <20030520221643.GB32072@daikokuya.co.uk> <Pine.LNX.4.53.0305210939320.16803@kern.srcf.societies.cam.ac.uk> <20030522195154.GA6157@daikokuya.co.uk> <3ED9AAC3.9000102@pop.agri.ch> <20030601132012.GC743@daikokuya.co.uk>
> 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