Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

reserved identifier violation #543

Open
elfring opened this issue Nov 5, 2012 · 4 comments
Open

reserved identifier violation #543

elfring opened this issue Nov 5, 2012 · 4 comments

Comments

@elfring
Copy link

elfring commented Nov 5, 2012

I would like to point out that identifiers like "_BLITBUFFER_H" and "_PDF_INPUT_H" do not fit to the expected naming convention of the C language standard.
Would you like to adjust your selection for unique names?

@tigran123
Copy link
Member

Thanks for letting us know. What is good enough for stdio.h is good enough for KPV, I think.

Btw, ironically, the example (from the URL you posted) of "compliant code" is itself using a "non-compliant" header stddef.h which has this type of guard against double-inclusion:

#ifndef _STDDEF_H
#define _STDDEF_H

At least on half a dozen of commercial Unix versions that I cared to check...

@hwhw
Copy link
Member

hwhw commented Nov 5, 2012

In fact, I never bothered to look into these matters, though I'm always
interested in respecting standards.
If I get it right, we as application developers should keep away from
underscore-prefixed defines, since they are reserved. That might very well
not apply to stddef.h, since it is toolchain-delivered. The risk in
question is to clash with such pre-defined headers.

I'd be fine with a rename. I probably just mimicked what I found elsewhere
in this case. I've got to admit that I wrote Linux kernel drivers,
applications and libraries using C, but am completely self-taught and there
are probably bits and pieces missing in my knowledge that I've assembled so
far :-)

@tigran123
Copy link
Member

Of course what @elfring said is absolutely true and right, but it is also ultra-super-maxi-pedantic :)

@hwhw
Copy link
Member

hwhw commented Nov 5, 2012

Maybe it's a trace of being grown up in Germany, but I have a soft spot for
pedantic approaches :-)
(Just joking, don't want to turn this into a stereotypes thing)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants