[LLVMbugs] [Bug 6961] New: Incorrect prototype missing void in argument (easy to fix).

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 28 01:40:59 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=6961

           Summary: Incorrect prototype missing void in argument (easy to
                    fix).
           Product: new-bugs
           Version: 2.7
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: Lars.Rasmusson at sics.se
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4753)
 --> (http://llvm.org/bugs/attachment.cgi?id=4753)
Patch that makes the function prototype correct.

In include/llvm-c/Target.h function prototypes are generated with a macro.

The function prototypes look like

void fun();

which when compiling with gcc gives the warning

warning: function declaration isn’t a prototype

The reason for this is according to
http://stackoverflow.com/questions/42125/function-declaration-isnt-a-prototype

In C foo() and foo(void) are different functions. foo() accepts an infinite
number of arguments, while foo(void) accepts 0 arguments. In C++ they mean the
same thing. I suggest that you use void consistently when you mean no
arguments.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list