Norcroft report 2004-10-11

Stefan Bellon sbellon at
Tue Oct 12 19:21:35 BST 2004

Peter Naulls wrote:
> In message <4cfc665276sbellon at> you wrote:

> > --- source/clib/string.h        15 Apr 2004 22:21:02 -0000      1.12
> > +++ source/clib/string.h        11 Oct 2004 21:57:03 -0000
> > @@ -202,7 +202,7 @@
> >     platforms.  */
> >  # ifdef        __USE_GNU
> >  extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
> > -#define ffsl(x) ffs(x)
> > +//#define ffsl(x) ffs(x)

> Well, this doesn't seem correct - disabling this define isn't going to
> improve matters if something needs to use it.  What problem are you
> seeing here?

Sorry, I didn't mean to send this patch, but another one. My fault.

The problem is in source/string/ffsll.c where there's a

#define ffsl __something_else

just before the

#include <string.h>

This results (quite correctly) in this error message:

"UnixLib:h.string", line 205: Error: differing redefinition of #define
macro ffsl

The proper fix is of course to patch source/string/ffsll.c and not
source/clib/string.h, sorry for that.

> > Additionally, I had to comment out unix.c.fnmatch from the generated
> > Makefile as this source file doesn't compile anymore with Norcroft
> > since the latest change. I haven't had the time to track down the
> > reason.

> Perhaps you can share with us the first few errors.

It's basically just one error, but one I completely fail to understand:

cc -depend !Depend -throwback -fcah -JUnixLib: -Wdap -D_GNU_SOURCE=1
-ccversion 553  -APCS 3/32bit/fpe3 -D__UNIXLIB_INTERNALS -c -o
unix.o.fnmatch ^.source.unix.c.fnmatch
Norcroft RISC OS ARM C vsn 5.55 [17 Oct 2003]
"^.source.unix.c.fnmatch", line 21: Warning: Undefined macro
'HAVE_CONFIG_H' in #if - treated as 0
"UnixLib:h.fnmatch", line 41: Warning: repeated definition of #define
macro __const
"^.source.unix.c.fnmatch", line 34: Warning: Undefined macro
'HAVE_STRING_H' in #if - treated as 0
"^.source.unix.c.fnmatch", line 369: Serious error: attempt to apply a
^.source.unix.c.fnmatch: 3 warnings, 0 errors, 1 serious error
AMU: *** exit (1) ***

AMU: *** 'all' not re-made because of errors ***

When I do only preprocessing (-E) instead of compiling (with otherwise
the same compiler switches), then the whole source/unix/fnmatch.c is
empty, just the includes assert.h, errno.h, fnmatch.h, ctype.h and
strings.h have been pulled in. And in fact, Norcroft happily compiles
this preprocessed file.

I even tried older versions of Norcroft, but they all exhibit the same

Stefan Bellon

More information about the gcc mailing list