[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
groff-1.17 and Compaq OSF/1 5.0
From: |
Nelson H. F. Beebe |
Subject: |
groff-1.17 and Compaq OSF/1 5.0 |
Date: |
Fri, 20 Jul 2001 08:32:58 -0600 (MDT) |
A build of groff-1.17 on Compaq OSF/1 5.0 with native C and C++
compilers produced this failure:
cxx -I. -I/home/mthnhb/alpha/build/groff-1.17/src/roff/groff
-I/home/mthnhb/alpha/build/groff-1.17/src/include
-I/home/mthnhb/alpha/build/groff-1.17/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_STRUCT_EXCEPTION=1
-DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=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
cxx: Error: groff.cc, line 125: too many arguments in function call
while ((opt = getopt_long(argc, argv,
----------------------------^
Examination of the preprocessor output showed that getopt_long had
this prototype:
extern int getopt_long ();
Thus, the lack of arguments led to the reject of the call at line 125.
The declaration of getopt_long in src/include/getopt.h is controlled
by the conditional
#if defined __STDC__ && __STDC__
...
#else
...
#endif
A simple test program shows how __STDC__ is defined by the Compaq C++
compiler:
% cat foo.cc
#if defined(__STDC__)
int stdc = __STDC__;
#else
int kandr = 1;
#endif
% cxx -E foo.cc
#line 1 "foo.cc"
int kandr = 1;
On a Sun Solaris 2.7 system, I get this:
% CC -E foo.cc
#2 "foo.cc"
int stdc = 0 ;
% g++ -E foo.cc
# 1 "foo.cc"
int stdc = 1;
Thus, on OSF/1 for C++ compilation with cxx, it is necessary to have
-D__STDC__=1 in the compilation options. The C compiler, cc, does not
permit this to be defined, so I changed the top-level Makefile to read
CCC=cxx -D__STDC__=1
There were two additional changes needed in yacc-generated source
code, to remove duplicate conflicting declarations of yylex() and
yyerror:
diff -c ./src/preproc/pic/pic.cc.~1~ ./src/preproc/pic/pic.cc
*** ./src/preproc/pic/pic.cc.~1~ Fri Jul 20 06:53:54 2001
--- ./src/preproc/pic/pic.cc Fri Jul 20 08:26:08 2001
***************
*** 33,39 ****
/* Maximum number of characters produced by printf("%g") */
#define GDIGITS 14
! int yylex();
void yyerror(const char *);
void reset(const char *nm);
--- 33,39 ----
/* Maximum number of characters produced by printf("%g") */
#define GDIGITS 14
! int yylex(void);
void yyerror(const char *);
void reset(const char *nm);
***************
*** 1362,1369 ****
--- 1362,1371 ----
#ifndef YY_NOPROTO
#if defined (__cplusplus)
extern "C" {
+ #if 0
extern void yyerror(char *);
extern int yylex();
+ #endif
#else /* __cplusplus */
extern int yylex(void);
#endif /* __cplusplus */
diff -c ./src/preproc/refer/label.cc.~1~ ./src/preproc/refer/label.cc
*** ./src/preproc/refer/label.cc.~1~ Fri Jul 20 06:55:42 2001
--- ./src/preproc/refer/label.cc Fri Jul 20 08:27:32 2001
***************
*** 1183,1190 ****
--- 1183,1192 ----
#ifndef YY_NOPROTO
#if defined (__cplusplus)
extern "C" {
+ #if 0
extern void yyerror(char *);
extern int yylex();
+ #endif
#else /* __cplusplus */
extern int yylex(void);
#endif /* __cplusplus */
With those changes, the build, check, and install successfully
completed.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- Center for Scientific Computing FAX: +1 801 585 1640, +1 801 581 4148 -
- University of Utah Internet e-mail: address@hidden -
- Department of Mathematics, 322 INSCC address@hidden address@hidden -
- 155 S 1400 E RM 233 address@hidden -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe -
-------------------------------------------------------------------------------
- groff-1.17 and Compaq OSF/1 5.0,
Nelson H. F. Beebe <=