public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/62294] New: Missing "passing argument [...] from incompatible pointer type" warning.
@ 2014-08-28 15:20 Emmanuel.Thome at inria dot fr
  2014-09-01 15:33 ` [Bug c/62294] [4.9 Regression] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Emmanuel.Thome at inria dot fr @ 2014-08-28 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 62294
           Summary: Missing "passing argument [...] from incompatible
                    pointer type" warning.
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Emmanuel.Thome at inria dot fr

Hi.

The following code should cause a warning.

#include <gmp.h>

void what(mpz_t a, mpz_t p, gmp_randstate_t rstate)
{
    mpz_urandomm(a, p, rstate); /* WRONG */
    mpz_urandomm(a, rstate, p); /* correct */
}

Alas, gcc-4.9.1 seems happy:
/tmp $ gcc-4.9 -W -Wall -Wextra -c b.c

gcc-4.8 moans appropriately.
/tmp $ gcc-4.8 -W -Wall -Wextra -c b.c
b.c: In function ‘what’:
b.c:5:5: warning: passing argument 2 of ‘__gmpz_urandomm’ from incompatible
pointer type [enabled by default]
     mpz_urandomm(a, p, rstate); /* WRONG */
     ^
In file included from b.c:1:0:
/usr/include/x86_64-linux-gnu/gmp.h:1115:21: note: expected ‘struct
__gmp_randstate_struct *’ but argument is of type ‘struct __mpz_struct *’
 __GMP_DECLSPEC void mpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr);
                     ^
b.c:5:5: warning: passing argument 3 of ‘__gmpz_urandomm’ from incompatible
pointer type [enabled by default]
     mpz_urandomm(a, p, rstate); /* WRONG */
     ^
In file included from b.c:1:0:
/usr/include/x86_64-linux-gnu/gmp.h:1115:21: note: expected ‘mpz_srcptr’ but
argument is of type ‘struct __gmp_randstate_struct *’
 __GMP_DECLSPEC void mpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr);

Here is gcc -v:

/tmp $ gcc-4.9 -v
Using built-in specs.
COLLECT_GCC=gcc-4.9
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.1-4'
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify
--enable-plugin --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.1 (Debian 4.9.1-4) 

I'm happy to provide any further information.

Regards,

E.
>From gcc-bugs-return-459417-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 28 15:52:01 2014
Return-Path: <gcc-bugs-return-459417-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24262 invoked by alias); 28 Aug 2014 15:52:01 -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 24229 invoked by uid 48); 28 Aug 2014 15:51:57 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/62294] [4.9 Regression] Missing "passing argument [...] from incompatible pointer type" warning.
Date: Thu, 28 Aug 2014 15:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.9.1
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
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: keywords bug_status cf_reconfirmed_on short_desc everconfirmed
Message-ID: <bug-62294-4-mOuwoFjq3F@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-62294-4@http.gcc.gnu.org/bugzilla/>
References: <bug-62294-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: 2014-08/txt/msg01914.txt.bz2
Content-length: 1007

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-08-28
            Summary|Missing "passing argument   |[4.9 Regression] Missing
                   |[...] from incompatible     |"passing argument [...]
                   |pointer type" warning.      |from incompatible pointer
                   |                            |type" warning.
     Ever confirmed|0                           |1

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Hmm, it works with gcc-5 where it is controlled by -Wincompatible-pointer-types
(enabled by default), but that's a recent thing and 4.9 was still supposed to
have it directly enabled by default...


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

end of thread, other threads:[~2014-09-03 13:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-28 15:20 [Bug c/62294] New: Missing "passing argument [...] from incompatible pointer type" warning Emmanuel.Thome at inria dot fr
2014-09-01 15:33 ` [Bug c/62294] [4.9 Regression] " mpolacek at gcc dot gnu.org
2014-09-03 12:54 ` mpolacek at gcc dot gnu.org
2014-09-03 12:55 ` mpolacek at gcc dot gnu.org
2014-09-03 13:21 ` mpolacek at gcc dot gnu.org
2014-09-03 13:23 ` Emmanuel.Thome at inria dot fr

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