GNU regex.h

GNU regex.h

icc for Linux (version 7.0) gives the following message when pre-processing GNU's regex.h (part of Linux, glibc, and several GNU packages, e.g. textutils) under RedHat 7.3 (the carets should be under the first underscore in _RE_ARGS, but they won't align properly):

./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,

Commenting out the declarations of regcomp and regexec in the include file (excerpted below) fixes things, but is this truly a problem with regex.h? gcc (of course) and pgcc don't have a problem with it.

/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
const char *__restrict __pattern,
int __cflags));

extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
const char *__restrict __string, size_t __nmatch,
regmatch_t __pmatch[__restrict_arr],
int __eflags));

extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));

extern void regfree _RE_ARGS ((regex_t *__preg));

Jon Bernard

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Thanks for the update.
Right. The problem is happening in the headerfile because __GNUC__ is not defined.
One workaround is
#define __GNUC__ 3
#undef __GNUC__

Or you can use the -restrict compilation option with the Intel compiler.

We are also in the process of fixing the default parameters in the compiler for this to work without any additional changes on your part.

Hope this works!

Leave a Comment

Please sign in to add a comment. Not a member? Join today