public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64531] New: `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors`
@ 2015-01-07 22:16 iamsupermouse at mail dot ru
  2015-02-21 22:43 ` [Bug c++/64531] " iamsupermouse at mail dot ru
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: iamsupermouse at mail dot ru @ 2015-01-07 22:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64531

            Bug ID: 64531
           Summary: `casting between pointer-to-function and
                    pointer-to-object` is still a warning instead of error
                    with `-pedantic -pedantic-errors`
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamsupermouse at mail dot ru

`-pedantic` causes g++ to emit a warning `ISO C++ forbids casting between
pointer-to-function and pointer-to-object` on this code:

int main()
{
    (void (*)()) (void *) 0;
}

I would expect `-pedantic -pedantic-errors` to generate a error with the same
message on this code, but it's still a warning.


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

* [Bug c++/64531] `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors`
  2015-01-07 22:16 [Bug c++/64531] New: `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors` iamsupermouse at mail dot ru
@ 2015-02-21 22:43 ` iamsupermouse at mail dot ru
  2015-02-22  4:41 ` redi at gcc dot gnu.org
  2015-02-23  9:52 ` harald at gigawatt dot nl
  2 siblings, 0 replies; 4+ messages in thread
From: iamsupermouse at mail dot ru @ 2015-02-21 22:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64531

Egor <iamsupermouse at mail dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |normal


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

* [Bug c++/64531] `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors`
  2015-01-07 22:16 [Bug c++/64531] New: `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors` iamsupermouse at mail dot ru
  2015-02-21 22:43 ` [Bug c++/64531] " iamsupermouse at mail dot ru
@ 2015-02-22  4:41 ` redi at gcc dot gnu.org
  2015-02-23  9:52 ` harald at gigawatt dot nl
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2015-02-22  4:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64531

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The standard now says "Converting a function pointer to an object pointer type
or vice versa is conditionally-supported."

GCC supports it, so there is not even a warning in GCC 4.9 or later, so it's
not very likely any change will be made to 4.8 now.


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

* [Bug c++/64531] `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors`
  2015-01-07 22:16 [Bug c++/64531] New: `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors` iamsupermouse at mail dot ru
  2015-02-21 22:43 ` [Bug c++/64531] " iamsupermouse at mail dot ru
  2015-02-22  4:41 ` redi at gcc dot gnu.org
@ 2015-02-23  9:52 ` harald at gigawatt dot nl
  2 siblings, 0 replies; 4+ messages in thread
From: harald at gigawatt dot nl @ 2015-02-23  9:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64531

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #2 from Harald van Dijk <harald at gigawatt dot nl> ---
It's already been fixed.

$ g++-4.8.4 -pedantic -pedantic-errors -c test.cc
test.cc: In function ‘int main()’:
test.cc:1:33: error: ISO C++ forbids casting between pointer-to-function and
pointer-to-object [-Werror=pedantic]
 int main() { (void(*)())(void *)0; }
                                 ^
cc1plus: some warnings being treated as errors

But the comments in PR 60850 note that this may have been a bad idea (at least
a bad idea for a release branch).
>From gcc-bugs-return-478144-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Feb 23 09:17:03 2015
Return-Path: <gcc-bugs-return-478144-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12034 invoked by alias); 23 Feb 2015 09:17:03 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11498 invoked by uid 55); 23 Feb 2015 09:16:58 -0000
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65084] Lack of type narrowing/widening inhibits good vectorization
Date: Mon, 23 Feb 2015 10:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenther at suse dot de
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65084-4-xVHreOZV6N@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65084-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65084-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-02/txt/msg02474.txt.bz2
Content-length: 1394

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide084

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> ---
On Fri, 20 Feb 2015, law at redhat dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?ide084
>
> --- Comment #5 from Jeffrey A. Law <law at redhat dot com> --- Some of
> the stuff you're doing in that patch matches what I was poking at as
> well (for a different BZ).  There's clearly much room for improvement
> here and if we weren't in stage4, I'd be pushing harder on expanding
> what these patterns do now rather than waiting.

Note that for aggressive narrowing (which eventually makes sense for
early GIMPLE) and for widening (which makes sense towards RTL expansion
with the targets word_mode / PROMOTE_MODE in mind) having a separate
pass that deals with the actual transform step (but re-using the
matching from the match.pd code) makes sense - triggering the transform
from forwprop via fold_stmt creates garbage that can confuse single-use
tests (yeah, it's on my list of things to investigate on whether we can
improve here in a somewhat generic way for GCC 6).

As in this bugs summary - what are the cases where vectorization
is bad because of the lack of widening?

> I'm already of the mind that we're going to want to factor some of that
> type testing so we're not repeating it in a half-dozen patterns.

Yeah, that makes sense.


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

end of thread, other threads:[~2015-02-23  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07 22:16 [Bug c++/64531] New: `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors` iamsupermouse at mail dot ru
2015-02-21 22:43 ` [Bug c++/64531] " iamsupermouse at mail dot ru
2015-02-22  4:41 ` redi at gcc dot gnu.org
2015-02-23  9:52 ` harald at gigawatt dot nl

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