Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-12166

Use #pragma once in header templates.

    XMLWordPrintable

Details

    • aaa8beab88dddd7218f6d3c30fb29c04679e2098 (qt-creator/qt-creator/master)

    Description

      Auto-generated headers currently use #include guards. It is better to use #pragma once for several reasons, so I suggest the default is changed. The reasons are:

      1. It's less verbose and ugly.
      2. It's less error-prone - e.g. no risk of two header files using the same guard define.
      3. It's faster to compile.
      4. It's not as much of a dirty hack.
      5. It's been supported on all major compilers for years.

      I realise this may attract a degree of "We've always done it this way and it works fine. Why would you want to improve things?" stuck-in-the-muds, but I hope you will ignore them.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-12166
          # Subject Branch Project Status CR V

          Activity

            People

              fbucek fbucek
              timmmm Tim
              Votes:
              21 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes