From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zack Weinberg To: John David Anglin Cc: gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: Unsatisfied symbols: cpp_register_pragma (code), cpp_register_pragma_space (code) Date: Fri, 08 Sep 2000 11:02:00 -0000 Message-id: <20000908110230.K23913@wolery.cumb.org> References: <20000908103800.J23913@wolery.cumb.org> <200009081743.NAA07854@hiauly1.hia.nrc.ca> X-SW-Source: 2000-09/msg00296.html On Fri, Sep 08, 2000 at 01:43:16PM -0400, John David Anglin wrote: > > > 2000-09-08 J. David Anglin > > > > > > lex.c (init_cp_pragma): Don't call cpp_register_pragma or > > > cpp_register_pragma_space if HANDLE_GENERIC_PRAGMAS is not defined. > > > > This is not right. #pragma [GCC] interface and implementation need to > > work irrespective of the value of HANDLE_GENERIC_PRAGMAS. The right > > fix is to adjust c-pragma.c so that the registry and dispatch routines > > don't depend on HANDLE_GENERIC_PRAGMAS, and c-lex.c so that the > > dispatch routine does get called. I'll try to generate a patch. > > Sound like this wan't right either: > > 2000-09-07 Richard Henderson > > * c-lex.c (process_directive): If not HANDLE_GENERIC_PRAGMAS, > do not call dispatch_pragma. No, it isn't. I believe the following is the correct patch; I can build a cross-compiler to hpux10 with it. Please give it a spin. zw * c-pragma.c: Don't elide entire file if !HANDLE_GENERIC_PRAGMAS. * c-pragma.h: Don't define HANDLE_GENERIC_PRAGMAS. Always prototype init_pragma, prototype dispatch_pragma if !USE_CPPLIB, never define init_pragma to nothing. * c-lex.c (process_directive): Revert previous change - always call dispatch_pragma. =================================================================== Index: c-pragma.c --- c-pragma.c 2000/09/07 22:24:31 1.35 +++ c-pragma.c 2000/09/08 17:59:14 @@ -32,8 +32,6 @@ Boston, MA 02111-1307, USA. */ #include "c-lex.h" #include "tm_p.h" -#ifdef HANDLE_GENERIC_PRAGMAS - #if USE_CPPLIB extern cpp_reader parse_in; #else @@ -438,10 +436,11 @@ dispatch_pragma () void init_pragma () { + cpp_reader *pfile ATTRIBUTE_UNUSED; #if !USE_CPPLIB - cpp_reader *pfile = 0; + pfile = 0; #else - cpp_reader *pfile = &parse_in; + pfile = &parse_in; #endif #ifdef HANDLE_PRAGMA_PACK @@ -450,7 +449,6 @@ init_pragma () #ifdef HANDLE_PRAGMA_WEAK cpp_register_pragma (pfile, 0, "weak", handle_pragma_weak); #endif - #ifdef REGISTER_TARGET_PRAGMAS REGISTER_TARGET_PRAGMAS (pfile); #endif @@ -460,5 +458,3 @@ init_pragma () mark_align_stack); #endif } - -#endif /* HANDLE_GENERIC_PRAGMAS */ =================================================================== Index: c-pragma.h --- c-pragma.h 2000/09/07 22:24:31 1.16 +++ c-pragma.h 2000/09/08 17:59:14 @@ -57,25 +57,11 @@ extern struct weak_syms * weak_decls; extern int add_weak PARAMS ((const char *, const char *)); #endif /* HANDLE_PRAGMA_WEAK */ - -/* Define HANDLE_GENERIC_PRAGMAS if any kind of front-end pragma - parsing is to be done. The code in GCC's generic C source files - will only look for the definition of this constant. They will - ignore definitions of HANDLE_PRAGMA_PACK and so on. */ -#if defined HANDLE_PRAGMA_PACK || defined HANDLE_PRAGMA_WEAK \ - || defined REGISTER_TARGET_PRAGMAS -#define HANDLE_GENERIC_PRAGMAS -#endif - -#ifdef HANDLE_GENERIC_PRAGMAS extern void init_pragma PARAMS ((void)); -# if !USE_CPPLIB +/* If cpplib is in use, it handles dispatch. */ +#if !USE_CPPLIB extern void dispatch_pragma PARAMS ((void)); -# endif - -#else -# define init_pragma() #endif /* Duplicate prototypes for the register_pragma stuff and the typedef for =================================================================== Index: c-lex.c --- c-lex.c 2000/09/08 01:38:08 1.99 +++ c-lex.c 2000/09/08 17:59:14 @@ -457,9 +457,7 @@ process_directive () if (!strcmp (name, "pragma")) { -#ifdef HANDLE_GENERIC_PRAGMAS dispatch_pragma (); -#endif goto skipline; } else if (!strcmp (name, "define"))