diff mbox

define TARGET_PRINTF_POINTER_FORMAT for powerpc-linux (77837)

Message ID 404516c1-7201-424a-7d81-36201f592fdd@gmail.com
State New
Headers show

Commit Message

Martin Sebor Oct. 3, 2016, 11:30 p.m. UTC
The attached patch adds definitions of TARGET_PRINTF_POINTER_FORMAT
to the rs6000 pair of linux.h and linux64.h headers, analogous to
the config/linux.h header.  This appears to be necessary since
unlike most other back ends, the rs6000 back end doesn't include
the latter linux.h.

The patch fixes bug 77837 - missing -Wformat-length warning for %p
with null argument on powerpc64.

Thanks
Martin

Comments

Segher Boessenkool Oct. 4, 2016, 1:10 a.m. UTC | #1
On Mon, Oct 03, 2016 at 05:30:35PM -0600, Martin Sebor wrote:
> The attached patch adds definitions of TARGET_PRINTF_POINTER_FORMAT
> to the rs6000 pair of linux.h and linux64.h headers, analogous to
> the config/linux.h header.  This appears to be necessary since
> unlike most other back ends, the rs6000 back end doesn't include
> the latter linux.h.
> 
> The patch fixes bug 77837 - missing -Wformat-length warning for %p
> with null argument on powerpc64.
> 
> Thanks
> Martin

> PR target/77837 - missing -Wformat-length warning for %p with null argument on powerpc64
> 
> gcc/ChangeLog:
> 2016-10-03  Martin Sebor  <msebor@redhat.com>
> 
> 	PR target/77837
> 	* config/rs6000/linux.h (TARGET_PRINTF_POINTER_FORMAT): Define.
> 	* config/rs6000/linux64.h (TARGET_PRINTF_POINTER_FORMAT): Likewise.

Okay for trunk, thanks!


Segher


p.s. You forgot to cc: the maintainers, and the email subject doesn't
start with "rs6000" or similar either, I found this mail by accident...
Martin Sebor Oct. 4, 2016, 2:11 a.m. UTC | #2
On 10/03/2016 07:10 PM, Segher Boessenkool wrote:
> On Mon, Oct 03, 2016 at 05:30:35PM -0600, Martin Sebor wrote:
>> The attached patch adds definitions of TARGET_PRINTF_POINTER_FORMAT
>> to the rs6000 pair of linux.h and linux64.h headers, analogous to
>> the config/linux.h header.  This appears to be necessary since
>> unlike most other back ends, the rs6000 back end doesn't include
>> the latter linux.h.
>>
>> The patch fixes bug 77837 - missing -Wformat-length warning for %p
>> with null argument on powerpc64.
>>
>> Thanks
>> Martin
>
>> PR target/77837 - missing -Wformat-length warning for %p with null argument on powerpc64
>>
>> gcc/ChangeLog:
>> 2016-10-03  Martin Sebor  <msebor@redhat.com>
>>
>> 	PR target/77837
>> 	* config/rs6000/linux.h (TARGET_PRINTF_POINTER_FORMAT): Define.
>> 	* config/rs6000/linux64.h (TARGET_PRINTF_POINTER_FORMAT): Likewise.
>
> Okay for trunk, thanks!
>
>
> Segher
>
>
> p.s. You forgot to cc: the maintainers, and the email subject doesn't
> start with "rs6000" or similar either, I found this mail by accident...

Thanks and my bad.  I thought Bill was one of them/you.  I'll
remember to CC you and David in the future.  Better yet, with
my increasingly volatile memory, I might write a script to do
it for me.

Martin
Martin Sebor Oct. 5, 2016, 5:19 p.m. UTC | #3
On 10/03/2016 08:11 PM, Martin Sebor wrote:
> On 10/03/2016 07:10 PM, Segher Boessenkool wrote:
>> On Mon, Oct 03, 2016 at 05:30:35PM -0600, Martin Sebor wrote:
>>> The attached patch adds definitions of TARGET_PRINTF_POINTER_FORMAT
>>> to the rs6000 pair of linux.h and linux64.h headers, analogous to
>>> the config/linux.h header.  This appears to be necessary since
>>> unlike most other back ends, the rs6000 back end doesn't include
>>> the latter linux.h.
>>>
>>> The patch fixes bug 77837 - missing -Wformat-length warning for %p
>>> with null argument on powerpc64.
>>>
>>> Thanks
>>> Martin
>>
>>> PR target/77837 - missing -Wformat-length warning for %p with null
>>> argument on powerpc64
>>>
>>> gcc/ChangeLog:
>>> 2016-10-03  Martin Sebor  <msebor@redhat.com>
>>>
>>>     PR target/77837
>>>     * config/rs6000/linux.h (TARGET_PRINTF_POINTER_FORMAT): Define.
>>>     * config/rs6000/linux64.h (TARGET_PRINTF_POINTER_FORMAT): Likewise.
>>
>> Okay for trunk, thanks!

I was able to fix this in r240793 without changing the rs6000 back
end so this patch is no longer necessary.

Thanks
Martin
diff mbox

Patch

PR target/77837 - missing -Wformat-length warning for %p with null argument on powerpc64

gcc/ChangeLog:
2016-10-03  Martin Sebor  <msebor@redhat.com>

	PR target/77837
	* config/rs6000/linux.h (TARGET_PRINTF_POINTER_FORMAT): Define.
	* config/rs6000/linux64.h (TARGET_PRINTF_POINTER_FORMAT): Likewise.

diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index ac9296d..e70fa02 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -138,3 +138,7 @@ 
   || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19)
 #define RS6000_GLIBC_ATOMIC_FENV 1
 #endif
+
+/* The format string to which "%p" corresponds.  */
+#undef TARGET_PRINTF_POINTER_FORMAT
+#define TARGET_PRINTF_POINTER_FORMAT gnu_libc_printf_pointer_format
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index e86b5d5..fa75bce 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -634,3 +634,7 @@  extern int dot_symbols;
   || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19)
 #define RS6000_GLIBC_ATOMIC_FENV 1
 #endif
+
+/* The format string to which "%p" corresponds.  */
+#undef TARGET_PRINTF_POINTER_FORMAT
+#define TARGET_PRINTF_POINTER_FORMAT gnu_libc_printf_pointer_format