public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro
@ 2012-11-19 21:00 hjl.tools at gmail dot com
  2012-11-20  5:14 ` [Bug c/55397] " konstantin.s.serebryany at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-11-19 21:00 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

             Bug #: 55397
           Summary: [asan] -faddress-sanitizer should define a CPP macro
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com


See:

http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01601.html


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

* [Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro
  2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
@ 2012-11-20  5:14 ` konstantin.s.serebryany at gmail dot com
  2012-11-20  5:24 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: konstantin.s.serebryany at gmail dot com @ 2012-11-20  5:14 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

Konstantin Serebryany <konstantin.s.serebryany at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |konstantin.s.serebryany at
                   |                            |gmail dot com

--- Comment #1 from Konstantin Serebryany <konstantin.s.serebryany at gmail dot com> 2012-11-20 05:13:27 UTC ---
Note that this will be incompatible with what clang uses
(http://clang.llvm.org/docs/AddressSanitizer.html#has_feature)
Clang will never use a CPP macro (I've lost this battle a year ago). 

Just FYI. I don't know how much compatibility we want and can achieve.


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

* [Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro
  2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
  2012-11-20  5:14 ` [Bug c/55397] " konstantin.s.serebryany at gmail dot com
@ 2012-11-20  5:24 ` pinskia at gcc dot gnu.org
  2012-11-20  5:32 ` konstantin.s.serebryany at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-11-20  5:24 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-11-20 05:23:29 UTC ---
(In reply to comment #1)
> Note that this will be incompatible with what clang uses
> (http://clang.llvm.org/docs/AddressSanitizer.html#has_feature)
> Clang will never use a CPP macro (I've lost this battle a year ago). 
> 
> Just FYI. I don't know how much compatibility we want and can achieve.

has feature will most likely not be implemented in GCC so CPP macro is correct
for GCC.  If clang wants to have a non-standard way of doing CPP macro for
features, that is up to them.


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

* [Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro
  2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
  2012-11-20  5:14 ` [Bug c/55397] " konstantin.s.serebryany at gmail dot com
  2012-11-20  5:24 ` pinskia at gcc dot gnu.org
@ 2012-11-20  5:32 ` konstantin.s.serebryany at gmail dot com
  2012-11-20  5:38 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: konstantin.s.serebryany at gmail dot com @ 2012-11-20  5:32 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

Konstantin Serebryany <konstantin.s.serebryany at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at google dot com

--- Comment #3 from Konstantin Serebryany <konstantin.s.serebryany at gmail dot com> 2012-11-20 05:30:59 UTC ---
FTR: my conversation with clang on this topic. 
http://comments.gmane.org/gmane.comp.compilers.clang.scm/42610

>From Diego: 
I don't know of any current effort in this area for GCC.  If 
__has_feature() is desirable, patches documenting and implementing it 
would be welcome.  The GCC pre-processor is jointly maintained by all 
the FE maintainers.  I would start there.


If we end up implementing a macro, may I ask it to be named ADDRESS_SANITIZER? 
This name is already used in a few places (Chromium, WebKit, etc).


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

* [Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro
  2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2012-11-20  5:32 ` konstantin.s.serebryany at gmail dot com
@ 2012-11-20  5:38 ` hjl.tools at gmail dot com
  2012-11-20  5:47 ` konstantin.s.serebryany at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-11-20  5:38 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2012-11-20 05:37:18 UTC ---
(In reply to comment #3)
> 
> If we end up implementing a macro, may I ask it to be named ADDRESS_SANITIZER? 
> This name is already used in a few places (Chromium, WebKit, etc).

It should have `_' prefix.


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

* [Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro
  2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2012-11-20  5:38 ` hjl.tools at gmail dot com
@ 2012-11-20  5:47 ` konstantin.s.serebryany at gmail dot com
  2012-11-21 20:21 ` hjl at gcc dot gnu.org
  2012-11-21 20:29 ` hjl.tools at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: konstantin.s.serebryany at gmail dot com @ 2012-11-20  5:47 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

--- Comment #5 from Konstantin Serebryany <konstantin.s.serebryany at gmail dot com> 2012-11-20 05:46:06 UTC ---
Then it should probably *not* be named _ADDRESS_SANITIZER 
(imagine a user trying to understand why ADDRESS_SANITIZER works for him 
with clang, where he added -DADDRESS_SANITIZER=1 manually, and dpoes not work
with gcc where he saw the documentation saying about _ADDRESS_SANITIZER)

Maybe something with GCC in the name?  _GCC_ADDRESS_SANITIZER?


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

* [Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro
  2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2012-11-20  5:47 ` konstantin.s.serebryany at gmail dot com
@ 2012-11-21 20:21 ` hjl at gcc dot gnu.org
  2012-11-21 20:29 ` hjl.tools at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: hjl at gcc dot gnu.org @ 2012-11-21 20:21 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

--- Comment #6 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> 2012-11-21 20:21:02 UTC ---
Author: hjl
Date: Wed Nov 21 20:20:42 2012
New Revision: 193704

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193704
Log:
Define __SANITIZE_ADDRESS__ for -fsanitize=address

    PR c/55397
    * cppbuiltin.c (define_builtin_macros_for_compilation_flags):
    Define __SANITIZE_ADDRESS__ for flag_asan.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cppbuiltin.c


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

* [Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro
  2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2012-11-21 20:21 ` hjl at gcc dot gnu.org
@ 2012-11-21 20:29 ` hjl.tools at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-11-21 20:29 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55397

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2012-11-21 20:28:52 UTC ---
Fixed.


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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-19 21:00 [Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro hjl.tools at gmail dot com
2012-11-20  5:14 ` [Bug c/55397] " konstantin.s.serebryany at gmail dot com
2012-11-20  5:24 ` pinskia at gcc dot gnu.org
2012-11-20  5:32 ` konstantin.s.serebryany at gmail dot com
2012-11-20  5:38 ` hjl.tools at gmail dot com
2012-11-20  5:47 ` konstantin.s.serebryany at gmail dot com
2012-11-21 20:21 ` hjl at gcc dot gnu.org
2012-11-21 20:29 ` hjl.tools at gmail dot com

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).