<< Back to previous view

[PCC-161] function declared without specifying arguments. Created: 25/Jun/10  Updated: 01/May/14

Status: Resolved
Project: pcc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: j sanchez Assignee: Anders Magnusson
Resolution: Fixed Votes: 1
Environment: OpenBSD


 Description   
   I'm having some issues with the tricky function declaration without
specific arguments (func()) and PCC. It seems like the declaration makes
PCC think in the function as it's allowed to receive arguments while the
definition says not.

here is the example code to this:

------------------------------------------------------------------------
#include <stdio.h>

int fa(); // declare fa() as "don't know about arguments"

int fa(void){ // define fa() as no arguments
   return 1;
}

int main(){

   int a=fa(1); // PCC allows this as thinks in fa() not fa(void)

   return 0;
}
------------------------------------------------------------------------

 Comments   
Comment by Anders Magnusson [ 01/May/14 05:02 PM ]
Now prototypes declared by functions will also override definitions.
Generated at Mon Nov 24 22:33:25 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.