I would like to point out that identifiers like "_SBXCLASS_HXX" and "_CPPCANVAS_CANVAS_HXX" do not fit to the expected naming convention of the C++ language standard. http://cgit.freedesktop.org/libreoffice/core/tree/include/basic/sbx.hxx?id=b9337e22ce1dbf2eba0e8c8db294ae99f4111f91#n20 http://cgit.freedesktop.org/libreoffice/core/tree/include/cppcanvas/canvas.hxx?id=b9337e22ce1dbf2eba0e8c8db294ae99f4111f91#n20 Would you like to adjust your selection for unique names? https://www.securecoding.cert.org/confluence/display/cplusplus/DCL32-CPP.+Do+not+declare+or+define+a+reserved+identifier#DCL32-CPP.Donotdeclareordefineareservedidentifier-NoncompliantCodeExample%28HeaderGuard%29
Fixed from 4.2 branch with: - http://cgit.freedesktop.org/libreoffice/core/commit/?id=29c0fdc6457243e7b7262b4db86c82b23a7ee0f1 - http://cgit.freedesktop.org/libreoffice/core/commit/?id=0bd7f12d41567842b1e31514e1d84340d90f5b42 Thomas: I assigned this bugtracker to you since you made the job! :-)
(In reply to comment #1) Thanks for your source code improvement. Can the script "fixincludeguards.sh" be eventually reused for other software?
(In reply to comment #1) Do any more include guards need similar corrections? Does a previous commit indicate further update candidates? http://cgit.freedesktop.org/libreoffice/core/commit/?id=8fc6905674142c226a117a97a08cf0b24c9d4fc1
Markus, you're right. This is a work in progress thing. And yes, some guards of 8fc6905674142c226a117a97a08cf0b24c9d4fc1 have to be corrected. This can simply be done by running fixincludeguards.sh on the appropriate files (on linux). And of course, you can reuse this script! :)
Thomas Arnhold committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2bd7767d010401199ad50c2ef2791b53ae03fb03 Resolves fdo#70681: fixincludeguards.pl: all that's left The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Most of the stuff is fixed now. There are some candidates and conflicts left, but that is work in progress. The majority of the headers are fixed now. Many headers don't have include guards indeed. You could use fixincludeguards.pl to identify them. Just in case you want to do some improvements :)