473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

warning: function is not a prototype

Hello - I have another warning coming from my code and I honestly don't know why it's complaining.

I have a simple file
Expand|Select|Wrap|Line Numbers
  1. #include header.h
  2.  
  3. void function1()
  4. {
  5.   does something;
  6. }
  7.  
  8. void function2()
  9. {
  10. }
  11.  
Notice that function2 is empty for now, but the compiler gives me "warning: function not a prototype" for line "void function2()". I didn't think there needs to be a prototype since its not being called before it(function1 doesn't call it)...is it a problem that it's empty ??

Thanks!

UPDATE: I put a "void" as the explicit parameter in function2 and it got rid of the warning. Does anyone know what the reasoning behing that is?
Jul 18 '08 #1
1 1508
weaknessforcats
9,208 Expert Mod 8TB
Sounds like a bogus warning. I compiled your example code using Visual Studio.NET 2008 and got no warnings or errors.

An empty function is OK in C++.
Jul 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: jose_luis_fdez_diaz_news | last post by:
Hi, If I don't include <libgen.h> I get then warnig below in regcmp call: warning: improper pointer/integer combination: op "=" but if I include it the warning is not shown, but them program...
10
by: Duncan Muirhead | last post by:
When I compile the program below "Program start" with gcc -std=c99 -pedantic -o bgcc bgcc.c (where gcc --version gives gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2) Copyright (C) 2004 Free Software...
8
by: Mat | last post by:
Hi all. This function is a GNU extension ok... so pls dont start with "this is not standard C", "go to comp.*.unix"... here I have more probability to get a good reply. BTW, when I compile my app...
6
by: subramanian | last post by:
Consider the following program: #include <stdio.h> void myfn(const int **a) { static int i, j, k; a = &i; a = &j;
13
by: Old Wolf | last post by:
I have some code that has in the header file: void foo( char bar ); and in the source file: void foo( bar ) char bar; { /* etc. */ } The compiler (with many warnings enabled) warns that...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
8
by: benn | last post by:
Here's the setup... Defines.h file contains: enum DAY { monday, tueday }; DayFunctions.h contains prototype: void printIsMonday ( enum DAY currentDay); DayFunctions.c contains:
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.