bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regex.h lacks configure tests for `restrict'?


From: Alexandre Duret-Lutz
Subject: regex.h lacks configure tests for `restrict'?
Date: Tue, 11 Feb 2003 23:14:44 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

Hi Jim!

Automake 1.7.2a adds dependency tracking support for ICC, so
I've tried to compile coreutils with it to see how that fumes.

This is coreutils-4.5.7, on Debian unstable, with Makefile.am
regenerated by Automake 1.7.2a, and configure run as
`./configure CC=icc'.  ICC is version 7.0, with substitute
headers slightly edited to accomodate my glibc (2.3.1).

Besides a few harmless warnings, the only error I had was with regex.h.

----------------------------------------------------------------------
source='c-stack.c' object='c-stack.o' libtool=no \
depfile='.deps/c-stack.Po' tmpdepfile='.deps/c-stack.TPo' \
depmode=icc /bin/sh ../config/depcomp \
icc -DLIBDIR=\"/usr/local/lib\" -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.    -g -c 
`test -f 'c-stack.c' || echo './'`c-stack.c
c-stack.c(241): warning #186: pointless comparison of unsigned integer with zero
          || rlimit.rlim_cur < 0
                             ^
[...]
source='umaxtostr.c' object='umaxtostr.o' libtool=no \
depfile='.deps/umaxtostr.Po' tmpdepfile='.deps/umaxtostr.TPo' \
depmode=icc /bin/sh ../config/depcomp \
icc -DLIBDIR=\"/usr/local/lib\" -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.    -g -c 
`test -f 'umaxtostr.c' || echo './'`umaxtostr.c
inttostr.c(33): warning #186: pointless comparison of unsigned integer with zero
    if (i < 0)
          ^
[...]
test -f 'ftw.c' || echo './'`ftw.c
source='regex.c' object='regex.o' libtool=no \
depfile='.deps/regex.Po' tmpdepfile='.deps/regex.TPo' \
depmode=icc /bin/sh ../config/depcomp \
icc -DLIBDIR=\"/usr/local/lib\" -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.    -g -c 
`test -f 'regex.c' || echo './'`regex.c
./regex.h(542): error: expected a ")"
  extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
                     ^

./regex.h(546): error: expected a ")"
  extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
                     ^

regex.c(7685): warning #589: transfer of control bypasses initialization of:
            variable "same_str_p" (declared at line 6133)
      goto restore_best_regs;
      ^

compilation aborted for regex.c (code 2)
make[3]: *** [regex.o] Error 2
make[3]: Leaving directory `/home/adl/projs/src/coreutils-4.5.7/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/adl/projs/src/coreutils-4.5.7/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/adl/projs/src/coreutils-4.5.7'
make: *** [all] Error 2
----------------------------------------------------------------------

Running icc on the preprocessed output I get something clearer:

----------------------------------------------------------------------
./regex.h(542): error: expected a ")"    
  extern int regcomp (regex_t *restrict __preg, const char *restrict __pattern, 
int __cflags);
                                        ^

./regex.h(546): error: expected a ")"
  extern int regexec (const regex_t *restrict __preg, const char *restrict 
__string, size_t __nmatch, regmatch_t __pmatch[], int __eflags);
                                              ^

regex.c(7685): warning #589: transfer of control bypasses initialization of:
            variable "same_str_p" (declared at line 6133)
      goto restore_best_regs;
      ^

compilation aborted for x.c (code 2)
----------------------------------------------------------------------

lib/regex.h mentions a configure test for `restrict'.  I can't see
where this is done.  The only mention of `restrict' in
config.log is when jm_INCLUDED_REGEX fails to include
/usr/include/regex.h.  This latter file also uses __restrict so
it fails for the same reason.  

I believe I should fix ICC's header to `#define __restrict',
since /usr/include/regex.h needs it, however it still looks
bogus that regex.h mention a test that jm_INCLUDED_REGEX
doesn't do.

I resumed compilation with `make CPPFLAGS=-Drestrict='.
(`CFLAGS=-std=c99' would also work.)

----------------------------------------------------------------------
source='pathchk.c' object='pathchk.o' libtool=no \
depfile='.deps/pathchk.Po' tmpdepfile='.deps/pathchk.TPo' \
depmode=icc /bin/sh ../config/depcomp \
icc -DLOCALEDIR=\"/usr/local/share/locale\" -DSHAREDIR=\"/usr/local/share\" 
-DHAVE_CONFIG_H -I. -I. -I.. -I.. -I. -I../lib -I../lib  -Drestrict=  -g -c 
`test -f 'pathchk.c' || echo './'`pathchk.c
pathchk.c(235): warning #191: type qualifier is meaningless on cast type
      if (portable_chars[(const unsigned char) *p] == 0)
                          ^

----------------------------------------------------------------------

Have fun!
-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]