[PATCH] libsanitizer: remove -pedantic option

H.J. Lu hjl.tools@gmail.com
Fri Nov 5 15:31:51 GMT 2021


On Fri, Nov 5, 2021 at 8:25 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 11/5/21 16:22, H.J. Lu wrote:
> > Should we add __extension__ here?
>
> I tried doing that but it didn't help me with the warning.
> Maybe I did something wrong?

[hjl@gnu-cfl-2 tmp]$ cat y.cc
#include <stdint.h>

#define uptr uintptr_t

#  define GET_CURRENT_PC()                \
   (__extension__ ({                      \
      uptr pc;                            \
      asm("lea 0(%%rip), %0" : "=r"(pc)); \
      pc;                                 \
    }))

uptr
foo (void)
{
  return GET_CURRENT_PC ();
}
[hjl@gnu-cfl-2 tmp]$ gcc -S -O2 y.cc -pedantic
[hjl@gnu-cfl-2 tmp]$


-- 
H.J.


More information about the Gcc-patches mailing list