[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

alloca, yacc and lex



The problem is that yacc is actually linked to bison and lex to flex.

The solution is to change the path to get yacc and lex, not bison and flex

bison generated code:

#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (
__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
 #pragma alloca
#else /* not MSDOS, __TURBOC__, or _AIX */
#ifdef __hpux
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* __hpux */
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc.  */
#endif /* not GNU C.  */
#endif /* alloca not defined.  */


picante: 34 % make clean
        rm -f rpc.ldmd *.o *.ln *.i *.log conftab.c confyy.c depends
picante: 35 % make
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  abbr.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  acl.c
        yacc conf.y
        mv y.tab.c conftab.c || mv conf.tab.c conftab.c
mv: y.tab.c: cannot access: No such file or directory
        lex conf.l
221/256 nodes(%e), 1129/1152 positions(%p), 110/128 (%n), 25621 transitions, 
301/384 packed char classes(%k), 2049/2176 packed transitions(%a), 4181/4352 
output slots(%o)
        mv lex.yy.c confyy.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  conftab.c 
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  forn_svc.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  ldmd.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  priv.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  remote.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  svc.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  svc4.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H -c  wordexp.c
        c89 -g -w -I../config -I. -I../misc -I../ulog -I../protocol -I../pq 
-DHAVE_CONFIG_H  abbr.o  acl.o  conftab.o  forn_svc.o  ldmd.o  priv.o  remote.o 
 svc.o  svc4.o  wordexp.o -L.. -lldm -lm -ly -lnsl_s -o rpc.ldmd
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (abbr.o) was 
detected. The linked output may not run on a PA 1.x system.
/usr/ccs/bin/ld: Unsatisfied symbols:
   alloca (code)
*** Error exit code 1



===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================