[Libreoffice-bugs] [Bug 143148] New: Use pragma once instead of include guards (Episode 2: Endgame)

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Jul 1 15:07:20 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=143148

            Bug ID: 143148
           Summary: Use pragma once instead of include guards (Episode 2:
                    Endgame)
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: ilmari.lauhakangas at libreoffice.org
                CC: mentoring at documentfoundation.org

Background: https://en.wikipedia.org/wiki/Include_guard

The task is to remove the include guards in the header files and replace them
with "#pragma once".

This report is a continuation of bug 124176 - please see the commits in it for
examples. The idea is to work on a few files per patch and move on to other
tasks. This is a good first task for beginners.

Keep in mind:
- leave the status as NEW and do not assign this to yourself - multi-hacker
tasks work like this
- write a brief, but informative commit message referring to the report ID
- don't leave extra blank lines in the source files

Simple command to get a list of possible candidates:

git grep "#ifndef" | grep hxx

Helper scripts are in bug 124176 comment 126 and bug 124176 comment 213

NOTE:

There are some source files containing include guards that are meant to also be
processed by compilers other than LO's build baseline compilers:

* All URE include files, see the (generated via odk/CustomTarget_allheaders.mk)
workdir/CustomTarget/odk/allheaders/allheaders.hxx for a complete list.

* Anything under odk/examples/.

For those source files, it is probably better to conservatively stick with
include guards than to replace them with #pragma once.

To generate the allheaders.hxx file, run

make CustomTarget_odk/allheaders

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210701/7561af7b/attachment.htm>


More information about the Libreoffice-bugs mailing list