Issue Details (XML | Word | Printable)

Key: PCC-372
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

-Wmissing-prototypes reports error for ANSI style function argument call

Created: 27/Jul/11 07:19 PM   Updated: 04/Sep/11 08:11 AM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386

 Description  « Hide
the following code example

static void
foo(void (*a)())

when compiled with pcc -Wmissing-prototypes produces an error

  foo.c:4: error: no previous prototype for `<pointer>'

(I think this is a fairly recent regression)

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 28/Jul/11 01:39 PM
Hm, I only get a warning. Which is correct, the function pointer has no prototype :-)

Iain Hibbert added a comment - 28/Jul/11 02:41 PM
Sorry yes, it is only a warning (I cut and paste from a command with -Werror above)

But is there something that might have changed recently that might have affected
this? I looked at the changelog and saw nothing significant, but the code (in NetBSD
libc/rpc/clnt_bcast.c) compiled fine a couple of weeks ago..

Iain Hibbert added a comment - 29/Jul/11 11:15 AM
The reason this issue has shown up is my commit

which enabled passing -Wmissing-prototypes to ccom (where previously, it was
always silently dropped by the front end)

[ and for reference gcc (4.1.3) does not complain about this lack of prototype ]

the code where the prototype is (in <rpc/xdr.h>) claims in a comment that it
can't be properly prototyped as some abuse is going on with varying numbers
of arguments, I will look at that..

Iain Hibbert added a comment - 04/Sep/11 08:11 AM
I have repaired the code that caused this warning in NetBSD