This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the EGCS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug: argp.h


Bug: argp.h

I just installed the OpenLinux 2.2.

File /usr/include/ctype.h has this declaration of tolower on line 112
   extern int tolower __P ((int __c));
Similar remarks apply for toupper.  The definition of tolower as a
function on line 155 is
   extern __inline int
   tolower (int __c)
   {
        return __c >= -128 && __c < 256 ? __tolower (__c) : __c;
   }

What is this "__P"?  It is defined in /usr/include/argp.h on line 40:
   #ifndef __P
   # if (defined __STDC__ && __STDC__) || defined __cplusplus
   #  if defined __GNUC__ && defined __cplusplus && __GNUC_MINOR__ >= 8
   #   define __P(args)    args  throw()
   #  else
   #   define __P(args)    args
   #  endif
   #  define __PMT(args)   args
   # else
   #  define __P(args)     ()
   #  define __PMT(args)   ()
   # endif
   #endif

My system chooses line 4 of the above and tolower in <ctype.h> is
Declaration:
   extern int tolower (int __c) throw();
Definition:
   extern __inline int tolower (int __c) { ... }
This is an error, though egcs gives just a warning.

My system chooses line 4 of the above and tolower in <ctype.h> is
Declaration:
   extern int tolower (int __c) throw();
Definition:
   extern __inline int tolower (int __c) { ... }
This is an error, though egcs gives just a warning.

The declaration says that tolower does not throw any exceptions.
The definition lacks the exception specification and hence it says
that tolower throws anything.

I think that LINE4 should be changed from
   #   define __P(args)    args  throw()
to
   #   define __P(args)    args

--
----------------------------------
Siemel B. Naran (sbnaran@uiuc.edu)
----------------------------------



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]