public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52615] New: function pointer casting bug
@ 2012-03-19 13:21 cglbftm at gmail dot com
  2012-03-19 14:10 ` [Bug c/52615] " rguenth at gcc dot gnu.org
  2014-02-05 10:43 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: cglbftm at gmail dot com @ 2012-03-19 13:21 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52615
           Summary: function pointer casting bug
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: cglbftm@gmail.com


gcc compiler can't create any working code for my programm.

Full programm here:

int a(char x)
{
  return x;
}

int main()
{
  float result;

  result = (*(float (*)(double, int, char *))a)(4.5f, 7, "Hello");
  return 0;
}

gcc input:

    gcc main.c

gcc output: 

main.c: In function 'main':
main.c:10:48: warning: function called through a non-compatible type [enabled
by
 default]
main.c:10:48: note: if this code is reached, the program will abort

Compiler create executable file. But it doesn't work.
Other compilers(g++, MSVC 10) works fine. No warnings and working programm.


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

end of thread, other threads:[~2014-02-05 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-19 13:21 [Bug c/52615] New: function pointer casting bug cglbftm at gmail dot com
2012-03-19 14:10 ` [Bug c/52615] " rguenth at gcc dot gnu.org
2014-02-05 10:43 ` 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).