<< Back to previous view

[PCC-372] -Wmissing-prototypes reports error for ANSI style function argument call Created: 27/Jul/11  Updated: 04/Sep/11

Status: Closed
Project: pcc
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Iain Hibbert Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: NetBSD/i386


 Description   
the following code example

static void
foo(void (*a)())
{
        (*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)

 Comments   
Comment by Anders Magnusson [ 28/Jul/11 01:39 PM ]
Hm, I only get a warning. Which is correct, the function pointer has no prototype :-)
Comment by Iain Hibbert [ 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..
Comment by Iain Hibbert [ 29/Jul/11 11:15 AM ]
The reason this issue has shown up is my commit

  http://pcc.ludd.ltu.se/fisheye/changelog/pcc/?cs=MAIN:plunky:20110727172445

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..
Comment by Iain Hibbert [ 04/Sep/11 08:11 AM ]
I have repaired the code that caused this warning in NetBSD
Generated at Sat Aug 30 06:11:54 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.