Splint errors

A

Andrea Crotti

I tried for curiosity to run splint on my code (and other code) and I
found this for example:

--8<---------------cut here---------------start------------->8---
SerialForwarder.h:41: Name _SERIALFORWARDER_H_ is in the implementation name
space (any identifier beginning with underscore)
External name is reserved for system use by ISO C99 standard. (Use either
-isoreserved or -namechecks to inhibit warning)
--8<---------------cut here---------------end--------------->8---

So is that really wrong to put guards written like this in the header?
How else am I supposed to call the guards otherwise?

Thanks..
 
J

Joachim Schmitz

Andrea said:
I tried for curiosity to run splint on my code (and other code) and I
found this for example:

--8<---------------cut here---------------start------------->8---
SerialForwarder.h:41: Name _SERIALFORWARDER_H_ is in the
implementation name space (any identifier
beginning with underscore) External name is reserved for system use
by ISO C99 standard. (Use either
-isoreserved or -namechecks to inhibit warning)
--8<---------------cut here---------------end--------------->8---

So is that really wrong to put guards written like this in the header?
How else am I supposed to call the guards otherwise?

Without the leading _

Bye, Jojo
 
E

Eric Sosman

Without the leading _

Many people suggest guarding "foo.h" and "bar.h" with FOO_H
and BAR_H, respectively. Unfortunately, this breaks down for
header files like "event.h" because many macro names starting
with E are reserved when <errno.h> is in play ...

I'd recommend using H_FOO and H_BAR as safer, albeit uglier,
alternatives.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top