why do we get nested extern declaration warnings in c code .
A:
You probably have include files without an include guard. That together with include files that include other include files can give your problem.
Add something like this to your include file, make sure each individual include file has a unique guard (e.g. the filename):
#ifndef MY_FILE_NAME_INCLUDE_GUARD
#define MY_FILE_NAME_INCLUDE_GUARD
#endif
Putte
2010-07-03 17:14:27
You need to make your inclusion guard definition unique. Add the name of the file in there, and perhaps some other identifiers The inclusion guard will not work if you try to include more than one file with the same guard definition.
A. Levy
2010-07-06 14:01:32
@A. Levy, edited answer to include your good points.
Putte
2010-07-08 22:13:54
And don't you ever use inclusion guard names that start with an underscore. They are reserved for the C implementation, and you in contrast are the C user.
Roland Illig
2010-07-15 18:34:54
@Roland Illig, you learn something new every day, answer edited accordingly.
Putte
2010-07-19 19:47:36