public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fwd: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
       [not found] <CAF5HaEVzxmXnzEuW6ZCDXxTu=apqWZNM+ggoUFDQpNvun91MEw@mail.gmail.com>
@ 2014-04-01 17:46 ` Daniel Gutson
  2014-04-04 12:19   ` Daniel Gutson
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Gutson @ 2014-04-01 17:46 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

I just realized I posted the patch in the wrong list.


---------- Forwarded message ----------
From: Daniel Gutson <daniel.gutson@tallertechnologies.com>
Date: Tue, Apr 1, 2014 at 10:43 AM
Subject: [PATCH] pedantic warning behavior when casting void* to
ptr-to-func, 4.8 and 4.9
To: gcc Mailing List <gcc@gcc.gnu.org>


Hi,

   I observed two different behaviors in gcc 4.8.2 and 4.9 regarding
the same issue, IMO both erroneous.

Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't
work in cases such as:
    void* p = 0;
#pragma GCC diagnostic ignored "-pedantic"
    F* f2 = reinterpret_cast<F*>(p);

(see testcase in the patch).

The attached patch attempts to fix this issue. Since I no longer have
write access, please
apply this for me if correct (is the 4.8 branch still alive for adding fixes?).

Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
even specifying -std=c++03.
Please let me know if this is truly a bug, in which case I could also
fix it for the latest version as well
(if so, please let me know if I should look into trunk or any other branch).

Thanks,

   Daniel.

2014-03-31  Daniel Gutson  <daniel.gutson@tallertechnologies.com>

gcc/cp/
        * typeck.c (build_reinterpret_cast_1): Pass proper argument to
warn() in pedantic.

gcc/testsuite/g++.dg/
        * diagnostic/pedantic.C: New test case.

[-- Attachment #2: pedantic.patch --]
[-- Type: text/x-patch, Size: 1085 bytes --]

--- gcc-4.8.2-orig/gcc/cp/typeck.c	2014-03-31 22:29:42.736367936 -0300
+++ gcc-4.8.2/gcc/cp/typeck.c	2014-03-31 14:26:43.536747050 -0300
@@ -6639,7 +6639,7 @@
 	   where possible, and it is necessary in some cases.  DR 195
 	   addresses this issue, but as of 2004/10/26 is still in
 	   drafting.  */
-	warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
+	warning (OPT_Wpedantic, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
       return fold_if_not_in_template (build_nop (type, expr));
     }
   else if (TREE_CODE (type) == VECTOR_TYPE)
--- gcc-4.8.2-orig/gcc/testsuite/g++.dg/diagnostic/pedantic.C	1969-12-31 21:00:00.000000000 -0300
+++ gcc-4.8.2/gcc/testsuite/g++.dg/diagnostic/pedantic.C	2014-03-31 17:24:42.532607344 -0300
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-pedantic" }
+typedef void F(void);
+
+void foo()
+{
+    void* p = 0;
+    F* f1 = reinterpret_cast<F*>(p);    // { dg-warning "ISO" }
+#pragma GCC diagnostic ignored "-pedantic"
+    F* f2 = reinterpret_cast<F*>(p);
+}
+

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-04-01 17:46 ` Fwd: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9 Daniel Gutson
@ 2014-04-04 12:19   ` Daniel Gutson
  2014-04-15 21:20     ` Richard Sandiford
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Gutson @ 2014-04-04 12:19 UTC (permalink / raw)
  To: gcc-patches

ping for maintainer.

Could this be considered for 4.8.3 please?

Thanks,

   Daniel.


On Tue, Apr 1, 2014 at 2:46 PM, Daniel Gutson
<daniel.gutson@tallertechnologies.com> wrote:
>
> I just realized I posted the patch in the wrong list.
>
>
> ---------- Forwarded message ----------
> From: Daniel Gutson <daniel.gutson@tallertechnologies.com>
> Date: Tue, Apr 1, 2014 at 10:43 AM
> Subject: [PATCH] pedantic warning behavior when casting void* to
> ptr-to-func, 4.8 and 4.9
> To: gcc Mailing List <gcc@gcc.gnu.org>
>
>
> Hi,
>
>    I observed two different behaviors in gcc 4.8.2 and 4.9 regarding
> the same issue, IMO both erroneous.
>
> Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't
> work in cases such as:
>     void* p = 0;
> #pragma GCC diagnostic ignored "-pedantic"
>     F* f2 = reinterpret_cast<F*>(p);
>
> (see testcase in the patch).
>
> The attached patch attempts to fix this issue. Since I no longer have
> write access, please
> apply this for me if correct (is the 4.8 branch still alive for adding fixes?).
>
> Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
> even specifying -std=c++03.
> Please let me know if this is truly a bug, in which case I could also
> fix it for the latest version as well
> (if so, please let me know if I should look into trunk or any other branch).
>
> Thanks,
>
>    Daniel.
>
> 2014-03-31  Daniel Gutson  <daniel.gutson@tallertechnologies.com>
>
> gcc/cp/
>         * typeck.c (build_reinterpret_cast_1): Pass proper argument to
> warn() in pedantic.
>
> gcc/testsuite/g++.dg/
>         * diagnostic/pedantic.C: New test case.

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-04-04 12:19   ` Daniel Gutson
@ 2014-04-15 21:20     ` Richard Sandiford
  2014-04-15 23:07       ` Daniel Gutson
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Sandiford @ 2014-04-15 21:20 UTC (permalink / raw)
  To: Daniel Gutson; +Cc: gcc-patches, jason

cc:ing Jason, who's the C++ maintainer.

Daniel Gutson <daniel.gutson@tallertechnologies.com> writes:
> ping for maintainer.
>
> Could this be considered for 4.8.3 please?
>
> Thanks,
>
>    Daniel.
>
>
> On Tue, Apr 1, 2014 at 2:46 PM, Daniel Gutson
> <daniel.gutson@tallertechnologies.com> wrote:
>>
>> I just realized I posted the patch in the wrong list.
>>
>>
>> ---------- Forwarded message ----------
>> From: Daniel Gutson <daniel.gutson@tallertechnologies.com>
>> Date: Tue, Apr 1, 2014 at 10:43 AM
>> Subject: [PATCH] pedantic warning behavior when casting void* to
>> ptr-to-func, 4.8 and 4.9
>> To: gcc Mailing List <gcc@gcc.gnu.org>
>>
>>
>> Hi,
>>
>>    I observed two different behaviors in gcc 4.8.2 and 4.9 regarding
>> the same issue, IMO both erroneous.
>>
>> Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't
>> work in cases such as:
>>     void* p = 0;
>> #pragma GCC diagnostic ignored "-pedantic"
>>     F* f2 = reinterpret_cast<F*>(p);
>>
>> (see testcase in the patch).
>>
>> The attached patch attempts to fix this issue. Since I no longer have
>> write access, please
>> apply this for me if correct (is the 4.8 branch still alive for adding fixes?).
>>
>> Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
>> even specifying -std=c++03.
>> Please let me know if this is truly a bug, in which case I could also
>> fix it for the latest version as well
>> (if so, please let me know if I should look into trunk or any other branch).
>>
>> Thanks,
>>
>>    Daniel.
>>
>> 2014-03-31  Daniel Gutson  <daniel.gutson@tallertechnologies.com>
>>
>> gcc/cp/
>>         * typeck.c (build_reinterpret_cast_1): Pass proper argument to
>> warn() in pedantic.
>>
>> gcc/testsuite/g++.dg/
>>         * diagnostic/pedantic.C: New test case.

--- gcc-4.8.2-orig/gcc/cp/typeck.c	2014-03-31 22:29:42.736367936 -0300
+++ gcc-4.8.2/gcc/cp/typeck.c	2014-03-31 14:26:43.536747050 -0300
@@ -6639,7 +6639,7 @@
 	   where possible, and it is necessary in some cases.  DR 195
 	   addresses this issue, but as of 2004/10/26 is still in
 	   drafting.  */
-	warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
+	warning (OPT_Wpedantic, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
       return fold_if_not_in_template (build_nop (type, expr));
     }
   else if (TREE_CODE (type) == VECTOR_TYPE)
--- gcc-4.8.2-orig/gcc/testsuite/g++.dg/diagnostic/pedantic.C	1969-12-31 21:00:00.000000000 -0300
+++ gcc-4.8.2/gcc/testsuite/g++.dg/diagnostic/pedantic.C	2014-03-31 17:24:42.532607344 -0300
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-pedantic" }
+typedef void F(void);
+
+void foo()
+{
+    void* p = 0;
+    F* f1 = reinterpret_cast<F*>(p);    // { dg-warning "ISO" }
+#pragma GCC diagnostic ignored "-pedantic"
+    F* f2 = reinterpret_cast<F*>(p);
+}
+

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-04-15 21:20     ` Richard Sandiford
@ 2014-04-15 23:07       ` Daniel Gutson
  2014-04-22 12:31         ` Daniel Gutson
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Gutson @ 2014-04-15 23:07 UTC (permalink / raw)
  To: Daniel Gutson, gcc-patches, jason, rdsandiford

On Tue, Apr 15, 2014 at 6:12 PM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> cc:ing Jason, who's the C++ maintainer.


FWIW: I created http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60850

>
> Daniel Gutson <daniel.gutson@tallertechnologies.com> writes:
>> ping for maintainer.
>>
>> Could this be considered for 4.8.3 please?
>>
>> Thanks,
>>
>>    Daniel.
>>
>>
>> On Tue, Apr 1, 2014 at 2:46 PM, Daniel Gutson
>> <daniel.gutson@tallertechnologies.com> wrote:
>>>
>>> I just realized I posted the patch in the wrong list.
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Daniel Gutson <daniel.gutson@tallertechnologies.com>
>>> Date: Tue, Apr 1, 2014 at 10:43 AM
>>> Subject: [PATCH] pedantic warning behavior when casting void* to
>>> ptr-to-func, 4.8 and 4.9
>>> To: gcc Mailing List <gcc@gcc.gnu.org>
>>>
>>>
>>> Hi,
>>>
>>>    I observed two different behaviors in gcc 4.8.2 and 4.9 regarding
>>> the same issue, IMO both erroneous.
>>>
>>> Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't
>>> work in cases such as:
>>>     void* p = 0;
>>> #pragma GCC diagnostic ignored "-pedantic"
>>>     F* f2 = reinterpret_cast<F*>(p);
>>>
>>> (see testcase in the patch).
>>>
>>> The attached patch attempts to fix this issue. Since I no longer have
>>> write access, please
>>> apply this for me if correct (is the 4.8 branch still alive for adding fixes?).
>>>
>>> Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
>>> even specifying -std=c++03.
>>> Please let me know if this is truly a bug, in which case I could also
>>> fix it for the latest version as well
>>> (if so, please let me know if I should look into trunk or any other branch).
>>>
>>> Thanks,
>>>
>>>    Daniel.
>>>
>>> 2014-03-31  Daniel Gutson  <daniel.gutson@tallertechnologies.com>
>>>
>>> gcc/cp/
>>>         * typeck.c (build_reinterpret_cast_1): Pass proper argument to
>>> warn() in pedantic.
>>>
>>> gcc/testsuite/g++.dg/
>>>         * diagnostic/pedantic.C: New test case.
>
> --- gcc-4.8.2-orig/gcc/cp/typeck.c      2014-03-31 22:29:42.736367936 -0300
> +++ gcc-4.8.2/gcc/cp/typeck.c   2014-03-31 14:26:43.536747050 -0300
> @@ -6639,7 +6639,7 @@
>            where possible, and it is necessary in some cases.  DR 195
>            addresses this issue, but as of 2004/10/26 is still in
>            drafting.  */
> -       warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
> +       warning (OPT_Wpedantic, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
>        return fold_if_not_in_template (build_nop (type, expr));
>      }
>    else if (TREE_CODE (type) == VECTOR_TYPE)
> --- gcc-4.8.2-orig/gcc/testsuite/g++.dg/diagnostic/pedantic.C   1969-12-31 21:00:00.000000000 -0300
> +++ gcc-4.8.2/gcc/testsuite/g++.dg/diagnostic/pedantic.C        2014-03-31 17:24:42.532607344 -0300
> @@ -0,0 +1,12 @@
> +// { dg-do compile }
> +// { dg-options "-pedantic" }
> +typedef void F(void);
> +
> +void foo()
> +{
> +    void* p = 0;
> +    F* f1 = reinterpret_cast<F*>(p);    // { dg-warning "ISO" }
> +#pragma GCC diagnostic ignored "-pedantic"
> +    F* f2 = reinterpret_cast<F*>(p);
> +}
> +



-- 

Daniel F. Gutson
Chief Engineering Officer, SPD


San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina


Phone: +54 351 4217888 / +54 351 4218211

Skype: dgutson

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-04-15 23:07       ` Daniel Gutson
@ 2014-04-22 12:31         ` Daniel Gutson
  2014-04-28 13:38           ` Daniel Gutson
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Gutson @ 2014-04-22 12:31 UTC (permalink / raw)
  To: Daniel Gutson, gcc-patches, Jason Merrill, rdsandiford

Ping for maintainer please.

Thanks,

   Daniel.

On Tue, Apr 15, 2014 at 7:05 PM, Daniel Gutson
<daniel.gutson@tallertechnologies.com> wrote:
> On Tue, Apr 15, 2014 at 6:12 PM, Richard Sandiford
> <rdsandiford@googlemail.com> wrote:
>> cc:ing Jason, who's the C++ maintainer.
>
>
> FWIW: I created http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60850
>
>>
>> Daniel Gutson <daniel.gutson@tallertechnologies.com> writes:
>>> ping for maintainer.
>>>
>>> Could this be considered for 4.8.3 please?
>>>
>>> Thanks,
>>>
>>>    Daniel.
>>>
>>>
>>> On Tue, Apr 1, 2014 at 2:46 PM, Daniel Gutson
>>> <daniel.gutson@tallertechnologies.com> wrote:
>>>>
>>>> I just realized I posted the patch in the wrong list.
>>>>
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Daniel Gutson <daniel.gutson@tallertechnologies.com>
>>>> Date: Tue, Apr 1, 2014 at 10:43 AM
>>>> Subject: [PATCH] pedantic warning behavior when casting void* to
>>>> ptr-to-func, 4.8 and 4.9
>>>> To: gcc Mailing List <gcc@gcc.gnu.org>
>>>>
>>>>
>>>> Hi,
>>>>
>>>>    I observed two different behaviors in gcc 4.8.2 and 4.9 regarding
>>>> the same issue, IMO both erroneous.
>>>>
>>>> Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't
>>>> work in cases such as:
>>>>     void* p = 0;
>>>> #pragma GCC diagnostic ignored "-pedantic"
>>>>     F* f2 = reinterpret_cast<F*>(p);
>>>>
>>>> (see testcase in the patch).
>>>>
>>>> The attached patch attempts to fix this issue. Since I no longer have
>>>> write access, please
>>>> apply this for me if correct (is the 4.8 branch still alive for adding fixes?).
>>>>
>>>> Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
>>>> even specifying -std=c++03.
>>>> Please let me know if this is truly a bug, in which case I could also
>>>> fix it for the latest version as well
>>>> (if so, please let me know if I should look into trunk or any other branch).
>>>>
>>>> Thanks,
>>>>
>>>>    Daniel.
>>>>
>>>> 2014-03-31  Daniel Gutson  <daniel.gutson@tallertechnologies.com>
>>>>
>>>> gcc/cp/
>>>>         * typeck.c (build_reinterpret_cast_1): Pass proper argument to
>>>> warn() in pedantic.
>>>>
>>>> gcc/testsuite/g++.dg/
>>>>         * diagnostic/pedantic.C: New test case.
>>
>> --- gcc-4.8.2-orig/gcc/cp/typeck.c      2014-03-31 22:29:42.736367936 -0300
>> +++ gcc-4.8.2/gcc/cp/typeck.c   2014-03-31 14:26:43.536747050 -0300
>> @@ -6639,7 +6639,7 @@
>>            where possible, and it is necessary in some cases.  DR 195
>>            addresses this issue, but as of 2004/10/26 is still in
>>            drafting.  */
>> -       warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
>> +       warning (OPT_Wpedantic, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
>>        return fold_if_not_in_template (build_nop (type, expr));
>>      }
>>    else if (TREE_CODE (type) == VECTOR_TYPE)
>> --- gcc-4.8.2-orig/gcc/testsuite/g++.dg/diagnostic/pedantic.C   1969-12-31 21:00:00.000000000 -0300
>> +++ gcc-4.8.2/gcc/testsuite/g++.dg/diagnostic/pedantic.C        2014-03-31 17:24:42.532607344 -0300
>> @@ -0,0 +1,12 @@
>> +// { dg-do compile }
>> +// { dg-options "-pedantic" }
>> +typedef void F(void);
>> +
>> +void foo()
>> +{
>> +    void* p = 0;
>> +    F* f1 = reinterpret_cast<F*>(p);    // { dg-warning "ISO" }
>> +#pragma GCC diagnostic ignored "-pedantic"
>> +    F* f2 = reinterpret_cast<F*>(p);
>> +}
>> +
>
>
>
> --
>
> Daniel F. Gutson
> Chief Engineering Officer, SPD
>
>
> San Lorenzo 47, 3rd Floor, Office 5
>
> Córdoba, Argentina
>
>
> Phone: +54 351 4217888 / +54 351 4218211
>
> Skype: dgutson



-- 

Daniel F. Gutson
Chief Engineering Officer, SPD


San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina


Phone: +54 351 4217888 / +54 351 4218211

Skype: dgutson

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-04-22 12:31         ` Daniel Gutson
@ 2014-04-28 13:38           ` Daniel Gutson
  2014-04-28 18:20             ` Jason Merrill
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Gutson @ 2014-04-28 13:38 UTC (permalink / raw)
  To: Daniel Gutson, gcc-patches, Jason Merrill, rdsandiford

Sorry, ping for maintainer.

We'd do need this for 4.8.3.

Thanks,

    Daniel.

On Tue, Apr 22, 2014 at 9:15 AM, Daniel Gutson
<daniel.gutson@tallertechnologies.com> wrote:
> Ping for maintainer please.
>
> Thanks,
>
>    Daniel.
>
> On Tue, Apr 15, 2014 at 7:05 PM, Daniel Gutson
> <daniel.gutson@tallertechnologies.com> wrote:
>> On Tue, Apr 15, 2014 at 6:12 PM, Richard Sandiford
>> <rdsandiford@googlemail.com> wrote:
>>> cc:ing Jason, who's the C++ maintainer.
>>
>>
>> FWIW: I created http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60850
>>
>>>
>>> Daniel Gutson <daniel.gutson@tallertechnologies.com> writes:
>>>> ping for maintainer.
>>>>
>>>> Could this be considered for 4.8.3 please?
>>>>
>>>> Thanks,
>>>>
>>>>    Daniel.
>>>>
>>>>
>>>> On Tue, Apr 1, 2014 at 2:46 PM, Daniel Gutson
>>>> <daniel.gutson@tallertechnologies.com> wrote:
>>>>>
>>>>> I just realized I posted the patch in the wrong list.
>>>>>
>>>>>
>>>>> ---------- Forwarded message ----------
>>>>> From: Daniel Gutson <daniel.gutson@tallertechnologies.com>
>>>>> Date: Tue, Apr 1, 2014 at 10:43 AM
>>>>> Subject: [PATCH] pedantic warning behavior when casting void* to
>>>>> ptr-to-func, 4.8 and 4.9
>>>>> To: gcc Mailing List <gcc@gcc.gnu.org>
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>>    I observed two different behaviors in gcc 4.8.2 and 4.9 regarding
>>>>> the same issue, IMO both erroneous.
>>>>>
>>>>> Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't
>>>>> work in cases such as:
>>>>>     void* p = 0;
>>>>> #pragma GCC diagnostic ignored "-pedantic"
>>>>>     F* f2 = reinterpret_cast<F*>(p);
>>>>>
>>>>> (see testcase in the patch).
>>>>>
>>>>> The attached patch attempts to fix this issue. Since I no longer have
>>>>> write access, please
>>>>> apply this for me if correct (is the 4.8 branch still alive for adding fixes?).
>>>>>
>>>>> Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
>>>>> even specifying -std=c++03.
>>>>> Please let me know if this is truly a bug, in which case I could also
>>>>> fix it for the latest version as well
>>>>> (if so, please let me know if I should look into trunk or any other branch).
>>>>>
>>>>> Thanks,
>>>>>
>>>>>    Daniel.
>>>>>
>>>>> 2014-03-31  Daniel Gutson  <daniel.gutson@tallertechnologies.com>
>>>>>
>>>>> gcc/cp/
>>>>>         * typeck.c (build_reinterpret_cast_1): Pass proper argument to
>>>>> warn() in pedantic.
>>>>>
>>>>> gcc/testsuite/g++.dg/
>>>>>         * diagnostic/pedantic.C: New test case.
>>>
>>> --- gcc-4.8.2-orig/gcc/cp/typeck.c      2014-03-31 22:29:42.736367936 -0300
>>> +++ gcc-4.8.2/gcc/cp/typeck.c   2014-03-31 14:26:43.536747050 -0300
>>> @@ -6639,7 +6639,7 @@
>>>            where possible, and it is necessary in some cases.  DR 195
>>>            addresses this issue, but as of 2004/10/26 is still in
>>>            drafting.  */
>>> -       warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
>>> +       warning (OPT_Wpedantic, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
>>>        return fold_if_not_in_template (build_nop (type, expr));
>>>      }
>>>    else if (TREE_CODE (type) == VECTOR_TYPE)
>>> --- gcc-4.8.2-orig/gcc/testsuite/g++.dg/diagnostic/pedantic.C   1969-12-31 21:00:00.000000000 -0300
>>> +++ gcc-4.8.2/gcc/testsuite/g++.dg/diagnostic/pedantic.C        2014-03-31 17:24:42.532607344 -0300
>>> @@ -0,0 +1,12 @@
>>> +// { dg-do compile }
>>> +// { dg-options "-pedantic" }
>>> +typedef void F(void);
>>> +
>>> +void foo()
>>> +{
>>> +    void* p = 0;
>>> +    F* f1 = reinterpret_cast<F*>(p);    // { dg-warning "ISO" }
>>> +#pragma GCC diagnostic ignored "-pedantic"
>>> +    F* f2 = reinterpret_cast<F*>(p);
>>> +}
>>> +
>>
>>
>>
>> --
>>
>> Daniel F. Gutson
>> Chief Engineering Officer, SPD
>>
>>
>> San Lorenzo 47, 3rd Floor, Office 5
>>
>> Córdoba, Argentina
>>
>>
>> Phone: +54 351 4217888 / +54 351 4218211
>>
>> Skype: dgutson
>
>
>
> --
>
> Daniel F. Gutson
> Chief Engineering Officer, SPD
>
>
> San Lorenzo 47, 3rd Floor, Office 5
>
> Córdoba, Argentina
>
>
> Phone: +54 351 4217888 / +54 351 4218211
>
> Skype: dgutson



-- 

Daniel F. Gutson
Chief Engineering Officer, SPD


San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina


Phone: +54 351 4217888 / +54 351 4218211

Skype: dgutson

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-04-28 13:38           ` Daniel Gutson
@ 2014-04-28 18:20             ` Jason Merrill
  2014-05-05 14:08               ` Richard Biener
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Merrill @ 2014-04-28 18:20 UTC (permalink / raw)
  To: Daniel Gutson, gcc-patches, rdsandiford

Applied, thanks.  Sorry for the delay.

Jason

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-04-28 18:20             ` Jason Merrill
@ 2014-05-05 14:08               ` Richard Biener
  2014-05-05 16:50                 ` Daniel Gutson
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Biener @ 2014-05-05 14:08 UTC (permalink / raw)
  To: Jason Merrill; +Cc: Daniel Gutson, gcc-patches, Richard Sandiford

On Mon, Apr 28, 2014 at 8:14 PM, Jason Merrill <jason@redhat.com> wrote:
> Applied, thanks.  Sorry for the delay.

It caused PR61066 on the branch.

Richard.

> Jason

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

* Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
  2014-05-05 14:08               ` Richard Biener
@ 2014-05-05 16:50                 ` Daniel Gutson
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Gutson @ 2014-05-05 16:50 UTC (permalink / raw)
  To: Richard Biener; +Cc: Jason Merrill, gcc-patches, Richard Sandiford

On Mon, May 5, 2014 at 11:08 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Mon, Apr 28, 2014 at 8:14 PM, Jason Merrill <jason@redhat.com> wrote:
>> Applied, thanks.  Sorry for the delay.
>
> It caused PR61066 on the branch.
>
> Richard.
>
>> Jason

It seems some tests didn't run when I tested the patch, sorry about that.
I'll try to run all the tests and update them as needed.
I will post the new patch as soon as possible.
Sorry for the inconveniences.

   Daniel.

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

end of thread, other threads:[~2014-05-05 16:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAF5HaEVzxmXnzEuW6ZCDXxTu=apqWZNM+ggoUFDQpNvun91MEw@mail.gmail.com>
2014-04-01 17:46 ` Fwd: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9 Daniel Gutson
2014-04-04 12:19   ` Daniel Gutson
2014-04-15 21:20     ` Richard Sandiford
2014-04-15 23:07       ` Daniel Gutson
2014-04-22 12:31         ` Daniel Gutson
2014-04-28 13:38           ` Daniel Gutson
2014-04-28 18:20             ` Jason Merrill
2014-05-05 14:08               ` Richard Biener
2014-05-05 16:50                 ` Daniel Gutson

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