On 2016-07-12 9:32 PM, Cory Nelson wrote:
On Fri, Jul 8, 2016 at 6:56 PM, Daniel Seither <p...@tiwoc.de> wrote:
Using clang 3.8 with -Wreserved-id-macro (enabled by -Weverything), I
just noticed that SQLite uses include guards with a leading underscore,
for example _SQLITE3_H_ in the amalgamation. According to the C
standard, this is a reserved identifier, leading to undefined behavior:
While uncommon, it is not unheard of for apps to use include guards to
check for a library's existence. While it is indeed not in compliance,
in practice fixing this may affect existing SQLite users.
My recommendation on this matter is to deprecate but retain the current include
guards that are in violation of the standard, and ALSO add new, redundant
include guards in a manner that comply with the standard.
Then update or add relevant documentation for application developers
recommending that they should be checking the new include guard names so that
their code would keep working properly should the old guard names ever be
removed in the future.
By doing that, existing users and unchanged codebases of SQLite should not see
anything break, but users would also have the opportunity to be proactive and
apply the minor changes necessary for their code to continue working with future
versions of SQLite that might remove the old include guards.
If the SQLite developers agree with this, then the main outstanding questions
then are what to name the new include guards and how best to document the change.
Thoughts on that proposal?
-- Darren Duncan
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users