public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb@sourceware.org>
Subject: [RFC] ARI related: Use of GCC poison pragma
Date: Thu, 15 Nov 2012 09:01:00 -0000	[thread overview]
Message-ID: <009b01cdc30f$c7684e80$5638eb80$@muller@ics-cnrs.unistra.fr> (raw)

  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

             reply	other threads:[~2012-11-15  9:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15  9:01 Pierre Muller [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='009b01cdc30f$c7684e80$5638eb80$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).