Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4245

[PATCH] Bad compilation flags in maintainer mode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.0.1
    • Fix Version/s: 10.0.2
    • Component/s: None
    • Labels:
      None

      Description

      File cmake/maintainer.cmake is setting invalid compiler flags for maintainer mode – invalid-offsetof warning can happen only in C++ compilation, not in C compilation. The following patch fixes the problem:

      --- a/cmake/maintainer.cmake
      +++ b/cmake/maintainer.cmake
      @@ -18,7 +18,7 @@ INCLUDE(CheckCCompilerFlag)
       # Setup GCC (GNU C compiler) warning options.
       MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS)
         SET(MY_MAINTAINER_WARNINGS
      -      "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Wno-invalid-offsetof -DFORCE_INIT_OF_VARS")
      +      "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -DFORCE_INIT_OF_VARS")
       
         CHECK_C_COMPILER_FLAG("-Wno-missing-field-initializers"
           HAVE_NO_MISSING_FIELD_INITIALIZERS)
      @@ -44,7 +44,7 @@ ENDMACRO()
       # Setup G++ (GNU C++ compiler) warning options.
       MACRO(SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS)
         SET(MY_MAINTAINER_CXX_WARNINGS
      -      "${MY_MAINTAINER_WARNINGS} -Wno-unused-parameter -Woverloaded-virtual"
      +      "${MY_MAINTAINER_WARNINGS} -Wno-invalid-offsetof -Wno-unused-parameter -Woverloaded-virtual"
             CACHE INTERNAL "C++ warning options used in maintainer builds.")
       ENDMACRO()
       
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            wlad Vladislav Vaintroub added a comment -

            Thanks for spotting the problem and for the patch!

            Show
            wlad Vladislav Vaintroub added a comment - Thanks for spotting the problem and for the patch!

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                pivanof Pavel Ivanov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h