473,413 Members | 1,764 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,413 software developers and data experts.

warning message regarding gcc -Wmissing-delcarations

121 100+
My code works fine with this command:
Expand|Select|Wrap|Line Numbers
  1. gcc mycode.c
It is compiled and runs just as I wanted.

But since my assignment has a specific restriction, my code must go through this:

Expand|Select|Wrap|Line Numbers
  1. gcc -pedantic-errors Wmissing-declarations -Wall -Werror -ansi mycode.c
Well, then it responds with a warning message:
gcc:Wmissing-declarations:No such file or directory.

I downloaded the pdf manual from gcc.gnu.org and found this description:
-Wmissing-declarations (C only)
Warn if a global function is defined without a previous declaration. Do so even
if the definition itself provides a prototype. Use this option to detect global
functions that are not declared in header files.


I've deleted all functions, even the prototypes, and left nothing in the body of main function, but I still got the same warning message.

Okay, I give up trying to figure out why...Why?
Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5.    printf("Blah Blah Blah!\n");
  6.  
  7.    return 0;
  8. }
Expand|Select|Wrap|Line Numbers
  1. gcc -pedantic-errors Wmissing-declarations -Wall -Werror -ansi why.c
gcc says:
gcc:Wmissing-declarations:No such file or directory.


Thanks in advance.
Oct 14 '07 #1
2 1820
oler1s
671 Expert 512MB
Take a very careful look at what you typed in. It's -Wmissing.... not Wmissing.

You forgot the "-".
Oct 14 '07 #2
mattmao
121 100+
Emmm...

My lecturer made a small typo in this line:
Expand|Select|Wrap|Line Numbers
  1. gcc -pedantic-errors Wmissing-declarations -Wall -Werror -ansi
Actually it should be this:
Expand|Select|Wrap|Line Numbers
  1. gcc -pedantic-errors -Wmissing-declarations -Wall -Werror -ansi
I took it from the assignment sheet without thinking.

Pity me:(
Oct 14 '07 #3

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

Similar topics

1
by: ddddd | last post by:
Regarding the Internet Explorer message below: "Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a...
3
by: William Payne | last post by:
Hello, when compiling my program I get a warning in one of my header files (globals.h) each time a source file includes it. The warning reads: globals.h:28: warning: `const...
4
by: DFP | last post by:
I am posting the gcc 3.3.2 compiler error and the source lines below them. Please explain this warning and how to fix it. crt/crtmap.hpp:17: warning: `std::map<K, D, C,...
27
by: MK | last post by:
I am a newbie. Please help. The following warning is issued by gcc-3.2.2 compiler (pc Linux): ================================================================== read_raw_data.c:51: warning:...
11
by: Ross | last post by:
I'm compiling some code over and over with no problems. The only differences between the versions is slightly different constants that are specific to various embedded devices that are getting...
6
by: Bart Simpson | last post by:
I am writing a shared object (Dll in Windows) and I am making extensive use of the STL. I am getting lots of warnings like this: ClassA.h(139): warning C4251: 'ClassA::indexarray' : class...
17
by: I.M. !Knuth | last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until I started goofing around with this: ...
4
by: gaurav.dube | last post by:
I am facing a problem with warning removal I have got a header file it contains extern declarations of lot of variables (say 100) This header file is included in hundreds of .c files. Some of...
4
by: lucavilla | last post by:
If you go to http://europe.nokia.com/A4305060, fill the "Enter your product code:" field with the value "0523183" and press "Go" (the ending page URL varies because there's a variable session-ID in...
1
by: dewi | last post by:
Dear All, I am trying to compile a C code using Visual C++. Can anyone explain how to solve it? Thank You. #include <math.h> #include <string.h> #include "RV2AJFRONT_NEW.h" #include...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.