Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-676

Allow #pragma once as construction preventing multiple inclusions

    Details

    • Type: RFC
    • Status: Withdrawn
    • Resolution: Done
    • Component/s: DM
    • Labels:
      None

      Description

      Text in 4.9 dealing with multiple exclusion shall be adjustment for C+11/GCC 4, allowing for #pragma once:

      4-9. Header files MUST include a construction that prevents multiple inclusion.

      The convention is an all uppercase construction of the full namespace, the file name and the h suffix.

      For a file named AntennaRx.h:

      #pragma once

      alternatively, #ifdef can be still used in existing code:
       
      #ifndef LSST_ANTENNA_RX_H // referring to file: AntennaRx.h
      #define LSST_ANTENNA_RX_H
      ...
      #endif // LSST_ANTENNA_RX_H

        Attachments

          Activity

            People

            • Assignee:
              pkubanek Petr Kubanek
              Reporter:
              pkubanek Petr Kubanek
              Watchers:
              Andy Clements, Dan Taranu, Igor Gaponenko, Krzysztof Findeisen, Petr Kubanek, Robert Lupton, Wil O'Mullane
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Planned End:

                Summary Panel