Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.30
    • 5.5.32
    • None
    • None
    • NetBSD 6.1 (and 5.1 being checked)

    Description

      The attached file fixes some compile time errors with respect to NetBSD 6.1 (and 5.1). Also its recommended for GCC that the option -Wno-char-subscripts be used to silence annoying compiler warnings about using a char for an array subscript (GCC folks need a life).

      Attachments

        Issue Links

          Activity

            achowe Anthony Howe added a comment -

            The _func_ patch doesn't appear to work (NetBSD 6.1, gcc 4.5.3), many of these warnings...

            Scanning dependencies of target strings
            [ 4%] Building C object strings/CMakeFiles/strings.dir/bchange.c.o
            In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0,
            from /usr/local/src/mariadb-5.5.30/strings/bchange.c:39:
            /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_func_" redefined
            /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition
            [ 4%] Building C object strings/CMakeFiles/strings.dir/bmove_upp.c.o
            In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0,
            from /usr/local/src/mariadb-5.5.30/strings/bmove_upp.c:38:
            /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_func_" redefined
            /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition
            [ 4%] Building C object strings/CMakeFiles/strings.dir/ctype-big5.c.o
            In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0,
            from /usr/local/src/mariadb-5.5.30/strings/ctype-big5.c:30:
            /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_func_" redefined
            /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition
            [ 4%] Building C object strings/CMakeFiles/strings.dir/ctype-bin.c.o
            In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0,
            from /usr/local/src/mariadb-5.5.30/strings/ctype-bin.c:22:
            /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_func_" redefined
            /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition

            My suggested fix was better.

            achowe Anthony Howe added a comment - The _ func _ patch doesn't appear to work (NetBSD 6.1, gcc 4.5.3), many of these warnings... Scanning dependencies of target strings [ 4%] Building C object strings/CMakeFiles/strings.dir/bchange.c.o In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0, from /usr/local/src/mariadb-5.5.30/strings/bchange.c:39: /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_ func _" redefined /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition [ 4%] Building C object strings/CMakeFiles/strings.dir/bmove_upp.c.o In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0, from /usr/local/src/mariadb-5.5.30/strings/bmove_upp.c:38: /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_ func _" redefined /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition [ 4%] Building C object strings/CMakeFiles/strings.dir/ctype-big5.c.o In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0, from /usr/local/src/mariadb-5.5.30/strings/ctype-big5.c:30: /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_ func _" redefined /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition [ 4%] Building C object strings/CMakeFiles/strings.dir/ctype-bin.c.o In file included from /usr/local/src/mariadb-5.5.30/strings/strings_def.h:20:0, from /usr/local/src/mariadb-5.5.30/strings/ctype-bin.c:22: /usr/local/src/mariadb-5.5.30/include/my_global.h:1453:0: warning: "_ func _" redefined /usr/include/sys/cdefs.h:353:0: note: this is the location of the previous definition My suggested fix was better.

            I might overlook something trivial, but how

            #if (_STDC_VERSION_ < 199901L) && !defined(_func_)
            as in my patch is the very same as

            #if _STDC_VERSION_ < 199901L

            1. ifndef _func_

            as in your patch? Could you please clarify?

            Thanks,
            Vladislav

            wlad Vladislav Vaintroub added a comment - I might overlook something trivial, but how #if (_ STDC_VERSION _ < 199901L) && !defined(_ func _) as in my patch is the very same as #if _ STDC_VERSION _ < 199901L ifndef _ func _ as in your patch? Could you please clarify? Thanks, Vladislav
            achowe Anthony Howe added a comment -

            You version falls through to the #else line 1453, whereas my version enters the #if _STDC_VERSION_ < 199901L section before applying #ifndef _func_.

            achowe Anthony Howe added a comment - You version falls through to the #else line 1453, whereas my version enters the #if _ STDC_VERSION _ < 199901L section before applying #ifndef _ func _.
            achowe Anthony Howe added a comment -

            Alternatively should work too:

            #ifndef _func_
            #if (_STDC_VERSION_ < 199901L)

            1. if _GNUC_ >= 2
            2. define _func_ _FUNCTION_
            3. else
            4. define _func_ "<unknown>"
            5. endif
              #elif defined(_MSC_VER)
            6. if _MSC_VER < 1300
            7. define _func_ "<unknown>"
            8. else
            9. define _func_ _FUNCTION_
            10. endif
              #elif defined(_BORLANDC_)
            11. define _func_ _FUNC_
              #else
            12. define _func_ "<unknown>"
              #endif
              #endif /* _func_ */
            achowe Anthony Howe added a comment - Alternatively should work too: #ifndef _ func _ #if (_ STDC_VERSION _ < 199901L) if _ GNUC _ >= 2 define _ func _ _ FUNCTION _ else define _ func _ "<unknown>" endif #elif defined(_MSC_VER) if _MSC_VER < 1300 define _ func _ "<unknown>" else define _ func _ _ FUNCTION _ endif #elif defined(_ BORLANDC _) define _ func _ _ FUNC _ #else define _ func _ "<unknown>" #endif #endif /* _ func _ */

            Yes, I like this most.

            wlad Vladislav Vaintroub added a comment - Yes, I like this most.

            People

              wlad Vladislav Vaintroub
              achowe Anthony Howe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.