franco ziade said:
I am compiling a directiry of source files which include a header with the
following
typedef unsigned char u_char;
when i compile the following error occurs.
duplicate specifier in declaration
What can it be? what should i be looking for in the system which can cause
this error?
That declaration looks ok. My best guess is that somewhere, probably
in a header that you include before the one with the typedef, the
identifier "u_char" is declared as a macro. For example, if "u_char"
expands to "unsigned char", the specifier "unsigned" appears twice.
(I don't get the same error message, but that's compiler specific, and
the expansion may be something other than "unsigned char".)
If adding
#undef u_char
just above the typedef avoids the error message, then that's your
problem. (This is a diagnostic, not a solution.)
Look for other occurrences of "u_char" in your header files. Try
commenting out other "#include" directives preceding the one for the
header containing the typedef; if that avoids the problem, the header
you commented out is probably the one causing it.
Finally, if you find a header that declares u_char as a macro rather
than as a typedef, complain bitterly to whomever is responsible for
that header. Using a macro rather than a typedef for something like
this is a bad idea.