public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/58286] New: Need option to make incompatible pointer types into compiler errors
@ 2013-08-30 22:14 ryao at gentoo dot org
  2014-06-30 12:40 ` [Bug c/58286] Need option to make incompatible pointer type warnings " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ryao at gentoo dot org @ 2013-08-30 22:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58286
           Summary: Need option to make incompatible pointer types into
                    compiler errors
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryao at gentoo dot org

Created attachment 30733
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30733&action=edit
Sample program that illustrates warning that cannot be selectively converted
into an error

Commandline options to change certain warnings into error messages are useful
when designing autotools checks. -Werror can be used for this, but warnings
like "warning: SSE instruction set disabled, using 387 arithmetics [enabled by
default]" will cause -Werror to make autotools checks that should succeed fail.
That broke an autotools check against the Linux kernel API in the ZFSOnLinux
SPL.

I have attached a sample program that demonstrates the warning that needs to be
made into an error for the autotools check to succeed. Clang supports
-Werror=incompatible-pointer-types, which selectively converts the warning into
an error. GCC does not appear to support that option under that name or any
other.


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

* [Bug c/58286] Need option to make incompatible pointer type warnings into compiler errors
  2013-08-30 22:14 [Bug debug/58286] New: Need option to make incompatible pointer types into compiler errors ryao at gentoo dot org
@ 2014-06-30 12:40 ` mpolacek at gcc dot gnu.org
  2014-07-01  8:32 ` mpolacek at gcc dot gnu.org
  2014-07-01  8:34 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-06-30 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-06-30
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.10.0
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Sounds reasonable.  Mine.


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

* [Bug c/58286] Need option to make incompatible pointer type warnings into compiler errors
  2013-08-30 22:14 [Bug debug/58286] New: Need option to make incompatible pointer types into compiler errors ryao at gentoo dot org
  2014-06-30 12:40 ` [Bug c/58286] Need option to make incompatible pointer type warnings " mpolacek at gcc dot gnu.org
@ 2014-07-01  8:32 ` mpolacek at gcc dot gnu.org
  2014-07-01  8:34 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-07-01  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Tue Jul  1 08:31:58 2014
New Revision: 212192

URL: https://gcc.gnu.org/viewcvs?rev=212192&root=gcc&view=rev
Log:
    PR c/58286
    * doc/invoke.texi: Document -Wincompatible-pointer-types.
c-family/
    * c.opt (Wincompatible-pointer-types): New option.
c/
    * c-typeck.c (convert_for_assignment): Pass
    OPT_Wincompatible_pointer_types instead of 0 to WARN_FOR_ASSIGNMENT.
testsuite/
    * gcc.dg/Wincompatible-pointer-types.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/Wincompatible-pointer-types.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c.opt
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/doc/invoke.texi
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c/58286] Need option to make incompatible pointer type warnings into compiler errors
  2013-08-30 22:14 [Bug debug/58286] New: Need option to make incompatible pointer types into compiler errors ryao at gentoo dot org
  2014-06-30 12:40 ` [Bug c/58286] Need option to make incompatible pointer type warnings " mpolacek at gcc dot gnu.org
  2014-07-01  8:32 ` mpolacek at gcc dot gnu.org
@ 2014-07-01  8:34 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-07-01  8:34 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-07-01  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30 22:14 [Bug debug/58286] New: Need option to make incompatible pointer types into compiler errors ryao at gentoo dot org
2014-06-30 12:40 ` [Bug c/58286] Need option to make incompatible pointer type warnings " mpolacek at gcc dot gnu.org
2014-07-01  8:32 ` mpolacek at gcc dot gnu.org
2014-07-01  8:34 ` mpolacek at gcc dot gnu.org

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