public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [RFC] ARI related: Use of GCC poison pragma
@ 2012-11-15  9:01 Pierre Muller
  2012-11-15 15:14 ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2012-11-15  9:01 UTC (permalink / raw)
  To: gdb

  To avoid resurgence of expunged ARI problems,
Pedro suggested the use of GCC poison pragma.

  The problem is that I have no experience with that 
kind of code.
  I looked into the gcc source,
and there seems to be a huge list of forbidden
macros and functions inside gcc/system.h
header.

Small extract of gcc-4.3.1 source:
#if (GCC_VERSION >= 3000)

/* Note autoconf checks for prototype declarations and includes
   system.h while doing so.  Only poison these tokens if actually
   compiling gcc, so that the autoconf declaration tests for malloc
   etc don't spuriously fail.  */
#ifdef IN_GCC
#undef calloc
#undef strdup
 #pragma GCC poison calloc strdup

#if !defined(FLEX_SCANNER) && !defined(YYBISON)
#undef malloc
#undef realloc
 #pragma GCC poison malloc realloc
#endif

/* Old target macros that have moved to the target hooks structure.  */
 #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN                      \
        FUNCTION_PROLOGUE FUNCTION_EPILOGUE                             \
        FUNCTION_END_PROLOGUE FUNCTION_BEGIN_EPILOGUE                   \

  What would be the corresponding gdb file?
I suppose it would be defs.h

 So would a patch adding 
#if (GCC_VERSION >= 3000)
#pragma GCC poison xvasprintf
#endif
(and probably lots of other functions aand macros)
be an acceptable way to introduce these poisons?


Pierre Muller
as ARI maintainer

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-15 20:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15  9:01 [RFC] ARI related: Use of GCC poison pragma Pierre Muller
2012-11-15 15:14 ` Joel Brobecker
2012-11-15 16:25   ` Pierre Muller
2012-11-15 17:57     ` Joel Brobecker
     [not found]   ` <50a51777.47f0440a.09dd.2b79SMTPIN_ADDED@mx.google.com>
2012-11-15 18:14     ` Pedro Alves
2012-11-15 20:13       ` Pierre Muller
2012-11-15 20:33         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).