Important: Please read the Qt Code of Conduct -

How to remove a Warning ?

  • Hello smart people.

    I have a quick question. I have this padding warning I can't seem to make to go away. How could I disable this type of warning (where do I have to add the flag)?

    alt text

  • Lifetime Qt Champion

    and you did app option to .pro file ?
    Its a compiler warning ( as you most likely know :)
    something like

    QMAKE_CXXFLAGS += -Wno-padded
    or maybe via

  • @mrjj Thanks for a quick reply.

    I have tried few options, yes. But none of them work, including yours. And the problem is, I have a big project I am working on and it is full of these exact warning. I just want to disable this particular one as it is not critical.

    Here, I still have it:
    alt text

  • Lifetime Qt Champion

    Ok. just to be sure.
    You are not using the Clang Code Model and its actually that one that says it ?

  • Lifetime Qt Champion

    QMAKE_CXXFLAGS_WARN_ON contains the flag -Wall.
    (overriding what to warn about )
    as far as i know so make sure what you try is AFTER
    ( you seem to use the OFF version so cant be that)
    This works for unused
    QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter,

    QMAKE_CXXFLAGS_WARN_ON += -Wno-padded

    Had no effect ?

    Do you have a small sample that gives this warning ?
    I cant get it to say it :)

  • @mrjj Yes, I am actually using Clang format and Clang Code Model.
    Is there a way to tell it to ignore this Warning ?

  • Moderators

    Go to Tools->Options->C++->Code Model tab.
    In the Clang Code Model Warnings box copy current configuration and add -Wno-padded to the options.

  • @Chris-Kawa Wow! that is exactly what I need. Just one more problem left.... field is not editable for some odd reason.

    alt text

    Sorry, my fault. I just had to copy pre-existing settings and I could edit them then. It is sorted. thanks so much guys for your time and help!

Log in to reply