Pelles C forum

C language => Beginner questions => Topic started by: boral on June 03, 2012, 09:56:55 AM

Title: What is the interpretation of this error message
Post by: boral on June 03, 2012, 09:56:55 AM
I was writing a program and while I compiled it I got this error.
I:\C programs\Program for finding first four central moments for grouped frequency distribution.c( 8 ): warning #2027: Missing prototype for 'printf'.
Will any one please explain in details what these numbers mean in the error message?
c( 8 ) and #2027
Title: Re: What is the interpretation of this error message
Post by: Vortex on June 03, 2012, 12:01:21 PM
It looks like that there is no any prototype specified for printf in your code. Did you include this line?

#include <stdio.h>
Title: Re: What is the interpretation of this error message
Post by: AlexN on June 03, 2012, 12:20:34 PM
Quote from: boral on June 03, 2012, 09:56:55 AM
Will any one please explain in details what these numbers mean in the error message?
c( 8 ) and #2027
8 is the line number in the editor, where the error occurs.
#2027 is the number of the error message " Missing prototype for 'printf'".
Title: Re: What is the interpretation of this error message
Post by: boral on June 03, 2012, 04:47:44 PM
Yes Vortex , I have included that line.
Thank you AlexN for your answer.
Title: Re: What is the interpretation of this error message
Post by: CommonTater on June 03, 2012, 05:01:27 PM
Hi Boral... About the filename...

"I:\C programs\Program for finding first four central moments for grouped frequency distribution.c"

While this is technically not a bad filename, you should be aware that many compiler's tool chains will have a problem with the length of it and many will trip over the spaces.  If there's any chance your code will be compiled by any other compiler, you should adopt a different naming convention for your files...  For example, most people call the main source file in their projects "main.c" ....



Title: Re: What is the interpretation of this error message
Post by: boral on June 03, 2012, 07:26:15 PM
Thanks CommonTater for your valuable advice.