public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/29247]  New: ABI not considered when checking if function pointers are compatible
@ 2006-09-27  2:33 acahalan at gmail dot com
  2006-09-27  2:41 ` [Bug target/29247] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: acahalan at gmail dot com @ 2006-09-27  2:33 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

A warning is missing. When functions differ by number of args,
a warning gets produced. None is provided for an ABI difference.

foo 0 $ cat mismatch.c
#ifdef TWO
typedef int(*fn_t)(int a, int b)__attribute__(( regparm(0) ));
#else
typedef int(*fn_t)(int a, int b, int c)__attribute__(( regparm(0) ));
#endif
int foo(fn_t fn);
int bar(int a, int b, int c) __attribute__(( regparm(3) ));
int baz(void){
        return foo(bar);
}
foo 0 $ gcc -W -Wall -O2 -c mismatch.c 
foo 0 $ gcc -W -Wall -O2 -DTWO -c mismatch.c 
mismatch.c: In function ‘baz’:
mismatch.c:9: warning: passing argument 1 of ‘foo’ from incompatible pointer
type
foo 0 $


-- 
           Summary: ABI not considered when checking if function pointers
                    are compatible
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: acahalan at gmail dot com


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


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

* [Bug target/29247] ABI not considered when checking if function pointers are compatible
  2006-09-27  2:33 [Bug c/29247] New: ABI not considered when checking if function pointers are compatible acahalan at gmail dot com
@ 2006-09-27  2:41 ` pinskia at gcc dot gnu dot org
  2006-09-27  2:44 ` pinskia at gcc dot gnu dot org
  2006-09-27  2:44 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-27  2:41 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3333 bytes --]



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-27 02:41 -------
It warns for me with 4.1.2 and the mainline:
[pinskia@celery regressions1]$ ~/gcc-4.1/bin/gcc ~/t2.c -W -Wall -S -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/pinskia/src/gcc/gcc-4.1/gcc/configure
--prefix=/home/pinskia/gcc-4.1/
Thread model: posix
gcc version 4.1.2 20060917 (prerelease)
 /home/pinskia/gcc-4.1/bin/../libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1 -quiet -v
-iprefix /home/pinskia/gcc-4.1/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/
/home/pinskia/t2.c -quiet -dumpbase t2.c -mtune=pentiumpro -auxbase t2 -W -Wall
-version -o t2.s
ignoring nonexistent directory
"/home/pinskia/gcc-4.1/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../i686-pc-linux-gnu/include"
ignoring duplicate directory
"/home/pinskia/gcc-4.1//lib/gcc/i686-pc-linux-gnu/4.1.2/include"
ignoring nonexistent directory
"/home/pinskia/gcc-4.1//lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/pinskia/gcc-4.1/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/include
 /usr/local/include
 /home/pinskia/gcc-4.1//include
 /usr/include
End of search list.
GNU C version 4.1.2 20060917 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 4.1.2 20060917 (prerelease).
GGC heuristics: --param ggc-min-expand=94 --param ggc-min-heapsize=121165
Compiler executable checksum: 3ccc0164c9173719947ca913043b7105
/home/pinskia/t2.c: In function ‘baz’:
/home/pinskia/t2.c:9: warning: passing argument 1 of ‘foo’ from incompatible
pointer type
[pinskia@celery regressions1]$ ~/gcc-local//bin/gcc ~/t2.c -W -Wall -S -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /src/gcc/local/gcc/configure --prefix=/home/pinskia/gcc-local
--enable-languages=c,fortran,java,obj-c++,ada
Thread model: posix
gcc version 4.2.0 20060925 (experimental)
 /home/pinskia/gcc-local/libexec/gcc/i686-pc-linux-gnu/4.2.0/cc1 -quiet -v
/home/pinskia/t2.c -quiet -dumpbase t2.c -mtune=generic -auxbase t2 -W -Wall
-version -o t2.s
ignoring nonexistent directory
"/home/pinskia/gcc-local/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /home/pinskia/gcc-local/include
 /home/pinskia/gcc-local/lib/gcc/i686-pc-linux-gnu/4.2.0/include
 /usr/include
End of search list.
GNU C version 4.2.0 20060925 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.0 20060925 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 21f00643e22e286bf27e853d830f4680
/home/pinskia/t2.c: In function ‘baz’:
/home/pinskia/t2.c:9: warning: passing argument 1 of ‘foo’ from incompatible
pointer type
[pinskia@celery regressions1]$


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |target
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.2


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


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

* [Bug target/29247] ABI not considered when checking if function pointers are compatible
  2006-09-27  2:33 [Bug c/29247] New: ABI not considered when checking if function pointers are compatible acahalan at gmail dot com
  2006-09-27  2:41 ` [Bug target/29247] " pinskia at gcc dot gnu dot org
  2006-09-27  2:44 ` pinskia at gcc dot gnu dot org
@ 2006-09-27  2:44 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-27  2:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-09-27 02:44 -------
Actually this was fixed in 3.4.0.
Reopening to ...


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |
   Target Milestone|4.1.2                       |3.4.0


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


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

* [Bug target/29247] ABI not considered when checking if function pointers are compatible
  2006-09-27  2:33 [Bug c/29247] New: ABI not considered when checking if function pointers are compatible acahalan at gmail dot com
  2006-09-27  2:41 ` [Bug target/29247] " pinskia at gcc dot gnu dot org
@ 2006-09-27  2:44 ` pinskia at gcc dot gnu dot org
  2006-09-27  2:44 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-27  2:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-09-27 02:44 -------
Mark as a dup of bug 19727.

*** This bug has been marked as a duplicate of 19727 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2006-09-27  2:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-27  2:33 [Bug c/29247] New: ABI not considered when checking if function pointers are compatible acahalan at gmail dot com
2006-09-27  2:41 ` [Bug target/29247] " pinskia at gcc dot gnu dot org
2006-09-27  2:44 ` pinskia at gcc dot gnu dot org
2006-09-27  2:44 ` pinskia at gcc dot gnu dot 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).