This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Fw: __STDC__ and __cplusplus are different



This is for getopt.h.


    Werner


			   Groff Bug Report

Please read the PROBLEMS file before sending in a bug report.

Please fill in all fields, even if you think they are not relevant.

Please delete the text in brackets before sending it in.

Please report separate bugs separately.

Send the completed form to bug-groff@gnu.org

GROFF VERSION:
1.17

MACHINE:
Sony PCV-J100

OS:
Microsoft Windows 2000 SP1 with UWIN 2.9
(see http://www.research.att.com/sw/tools/uwin/)

COMPILER:
Microsoft VC++ 6.0 SP5 with UWIN front end

INPUT FILES:
none required

COMMAND LINE:
./configure && make

DESCRIPTION OF INCORRECT BEHAVIOUR:
make fails due to non-prototyped declaration of getopt_long in getopt.h

make output:

CC -I. -I/y/groff/groff-current/src/roff/groff -I/y/groff/groff-current/src/include -I/y/groff/groff-current/src/include -DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_MATH_H=1 -DRET_TYPE_SRAND_IS_VOID=1 -DHAVE_SYS_NERR=1 -DHAVE_SYS_ERRLIST=1 -DHAVE_CC_LIMITS_H=1 -DRETSIGTYPE=void -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_FMOD=1 -DHAVE_STRTOL=1 -DHAVE_GETCWD=1 -DHAVE_STRERROR=1 -DHAVE_PUTENV=1 -DHAVE_RENAME=1 -DHAVE_MKSTEMP=1 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -DHAVE_STRDUP=1  -g  -c groff.cc
groff.cc(127) : error C2660: 'getopt_long' : function does not take 5 parameters
groff.cc(128) : fatal error C1903: unable to recover from previous error(s); stopping compilation
make[2]: *** [groff.o] Error 1
make[2]: Leaving directory `/Y/groff/groff-current/src/roff/groff'
make[1]: Entering directory `/Y/groff/groff-current'
make[1]: *** [src/roff/groff] Error 2
make[1]: Leaving directory `/Y/groff/groff-current'
make: *** [all] Error 2

SUGGESTED FIX [optional]:
*** src/include/getopt.h.orig	Thu Apr 19 22:09:28 2001
--- src/include/getopt.h	Thu Apr 19 22:12:17 2001
***************
*** 82,88 ****
  
  struct option
  {
! # if defined __STDC__ && __STDC__
    const char *name;
  # else
    char *name;
--- 82,88 ----
  
  struct option
  {
! #if ( defined (__STDC__) && __STDC__ ) || defined (__cplusplus)
    const char *name;
  # else
    char *name;
***************
*** 126,132 ****
     arguments to the option '\0'.  This behavior is specific to the GNU
     `getopt'.  */
  
! #if defined __STDC__ && __STDC__
  # ifdef __GNU_LIBRARY__
  /* Many other libraries have conflicting prototypes for getopt, with
     differences in the consts, in stdlib.h.  To avoid compilation
--- 126,132 ----
     arguments to the option '\0'.  This behavior is specific to the GNU
     `getopt'.  */
  
! #if ( defined (__STDC__) && __STDC__ ) || defined (__cplusplus)
  # ifdef __GNU_LIBRARY__
  /* Many other libraries have conflicting prototypes for getopt, with
     differences in the consts, in stdlib.h.  To avoid compilation



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