[Bug c++/30952] Unclear error message when callling via a function pointer

2021-08-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30952

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2009-06-03 22:19:39 |2021-8-11

--- Comment #4 from Andrew Pinski  ---
There are actually two different issues, one dealing with -fpermissive and the
other dealing with function pointers.

Take:
void (*sub) (int * x, void ** y);
void s (int * x, void ** y);
void call (int a, int * b)
{
  s(a, b);
  sub(a, b);
}

We produce:
: In function 'void call(int, int*)':
:5:5: error: invalid conversion from 'int' to 'int*' [-fpermissive]
5 |   s(a, b);
  | ^
  | |
  | int
:5:8: error: cannot convert 'int*' to 'void**'
5 |   s(a, b);
  |^
  ||
  |int*
:2:26: note:   initializing argument 2 of 'void s(int*, void**)'
2 | void s (int * x, void ** y);
  |  ^
:6:7: error: invalid conversion from 'int' to 'int*' [-fpermissive]
6 |   sub(a, b);
  |   ^
  |   |
  |   int
:6:10: error: cannot convert 'int*' to 'void**' in argument passing
6 |   sub(a, b);
  |  ^
  |  |
  |  int*

Notice how only the second argument for s gets the note "initializing argument"
while the first does not.
sub gets neither.

[Bug c++/30952] Unclear error message when callling via a function pointer

2011-03-09 Thread schnetter at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30952

--- Comment #2 from Erik Schnetter schnetter at gmail dot com 2011-03-09 
12:56:16 UTC ---
Created attachment 23596
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23596
failing source code


[Bug c++/30952] Unclear error message when callling via a function pointer

2011-03-09 Thread schnetter at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30952

Erik Schnetter schnetter at gmail dot com changed:

   What|Removed |Added

  Attachment #23596|0   |1
is obsolete||

--- Comment #3 from Erik Schnetter schnetter at gmail dot com 2011-03-09 
12:57:23 UTC ---
Comment on attachment 23596
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23596
failing source code

I attached this source file to the wrong bug report. Please disregard it.


[Bug c++/30952] Unclear error message when callling via a function pointer

2007-02-25 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2007-02-25 10:29 ---
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|normal  |enhancement
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||diagnostic
   Last reconfirmed|-00-00 00:00:00 |2007-02-25 10:29:23
   date||


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