hughsie / libxmlb

A library to help create and query binary XML blobs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reserved identifier violation

elfring opened this issue · comments

I would like to point out that identifiers like “__LIBXMLB_H_INSIDE__” and “_XbBuilderClassdo eventually not fit to the expected naming convention of the C language standard.
💭 Would you like to adjust your selection for unique names?

I think this is an exceptionally common style used by thousands of projects. I don't think it's useful to change them (or in the second case, even possible) at this point, sorry.

How do you think about to avoid that this software depends on undefined behaviour? 🤔

The double underscore isn't reserved in C, only C++.

👀 Please take another look at the involved language specifcations.

💭 I hope that the probability can be considerably reduced for undesirable programming mistakes.

I did take another look. Where does it say that you can't have double underscores in the C (not CPP) specification?

Do you find the wording “All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.” in a section like 7.1.3 from the official version of the standard for the programming language “C”?

"begin with an underscore" -- in specifications the "an" means singular. ________FOO would be perfectly valid.

The use of reserved identifiers is valid for implementations of the programming languages “C” and “C++”.

Ignorance of corresponding rules triggers risks for undesirable software behaviour, doesn't it? 🤔

You fell for my trick. You're a good bot, but not that good. Comment again and I'll report you.

I find it strange that you interpret the provided constructive advice as coming from a “bot”.
Please take another look at available information sources.

@hughsie is right though - also, this style is so insanely common that you would be crazy to break it on purpose as language author. Avoiding it doesn't even help you to not get bitten by words becoming reserved words in future (like the use of "requires", which is a keyword in C++ now, auto was a similar case but had a very long phase where it was known to be coming)
So, in general, changing any of this is a lot of work for pretty much zero gain.

@ximion it's a bot, don't poke the bear 🙂