Problem with new function style declarations and attribute((regparm)

Andreas Jaeger aj@arthur.rhein-neckar.de
Fri Sep 24 11:03:00 GMT 1999


The appended code compiles just fine with old function style
declarations but doesn't compile with the newer style:
aj@gromit:/tmp > /opt/gcc-2.95/bin/gcc -c aio-test.c -Wall  -DBUGGY
aio-test.c:22: conflicting types for `__aio_sigqueue'
aio-test.c:10: previous declaration of `__aio_sigqueue'
aj@gromit:/tmp > /opt/gcc-2.95/bin/gcc -c aio-test.c -Wall         

If I remove the __attribute__ on the declaration everything is fine.

I'm using gcc 2.95.1 but the current gcc 2.96 cvs version has the same 
problem.

Andreas


typedef union sigval
  {
    int sival_int;
    void *sival_ptr;
  } sigval_t;
typedef int __pid_t;
typedef __pid_t pid_t;

extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
     __attribute__ ((regparm (3), stdcall)) ;

#if BUGGY
int
__aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
#else
int
__aio_sigqueue (sig, val, caller_pid)
     int sig;
     const union sigval val;
     pid_t caller_pid;
#endif
{
  return 0;
}

-- 
 Andreas Jaeger   aj@suse.de	aj@arthur.rhein-neckar.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


More information about the Gcc-bugs mailing list