Menu

#579 'diagnostic pop' pragma without 'diagnostic push' in Drawable.h

v1.0_(example)
closed-fixed
None
5
2018-11-29
2018-11-28
No

Since version 1.3.31, Clang raises two warnings in Drawable.h:

/usr/local/include/GraphicsMagick/Magick++/Drawable.h:2925:26: error: pragma diagnostic pop could not pop, no matching push [-Werror,-Wunknown-pragmas]
#pragma clang diagnostic pop
                         ^
/usr/local/include/GraphicsMagick/Magick++/Drawable.h:2926:26: error: pragma diagnostic pop could not pop, no matching push [-Werror,-Wunknown-pragmas]
#pragma clang diagnostic pop

It seems related to commit https://sourceforge.net/p/graphicsmagick/code/ci/056042125005b891a94c9834eae0623de20be2b5/ that adds two diagnostic pop without the corresponding diagnostic push before to change Clang diagnostic messages at the file beginning.

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2018-11-28

    On Wed, 28 Nov 2018, Roland Denis wrote:

    Since version 1.3.31, Clang raises two warnings in Drawable.h:
    ```
    /usr/local/include/GraphicsMagick/Magick++/Drawable.h:2925:26: error: pragma diagnostic pop could not pop, no matching push [-Werror,-Wunknown-pragmas]

    pragma clang diagnostic pop

                        ^
    

    /usr/local/include/GraphicsMagick/Magick++/Drawable.h:2926:26: error: pragma diagnostic pop could not pop, no matching push [-Werror,-Wunknown-pragmas]

    pragma clang diagnostic pop

    What version of clang is being used when these warnings are produced?
    Perhaps the warning needs to be supported by the compiler before it
    can be ignored or a minimum clang version is required to support this
    feature.

    I am not seeing this with clang 4.0 or 6.0.

    Bob

     
  • Roland Denis

    Roland Denis - 2018-11-28

    This simple code

    #include "Magick++.h"
    
    int main() {
        return 0;
    }
    

    triggers both warnings under Ubuntu 16.04 using Clang 4.0, 5.0 and 6.0. Adding the same number of diagnostic push at the beginning of the file (before the diagnostic ignored) solves the issue on my side.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-11-29
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-11-29

    This issue should be fixed by changeset 15850:d4a5e3d16957. Please verify that it is fixed on your end. It is odd that this warning was not produced when compiling the Magick++ test programs and demos.

     
  • Roland Denis

    Roland Denis - 2018-11-29

    May some warnings be disabled in the test and demo suite ? Anyway, I confirm you that this commit fixes the issue on my side.

    Thanks for your work!

     

Log in to post a comment.

MongoDB Logo MongoDB