PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.45k stars 1.13k forks source link

How do you silence TBB warnings during compiling? #3035

Open ColinKennedy opened 1 month ago

ColinKennedy commented 1 month ago

While working with USD, for as long as I can remember back to USD 19.11, there are warnings when including USD headers. I'd like to ideally have "warnings as errors" -Werror enabled but warnings like these would false positive and prevent builds. I'd like to completely silence them, how can I do that?

.../USD-v24.03-python-3.10.12/include/tbb/task.h|21 col 139| note: ‘#pragma message: TBB Warning: tbb/task.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.’
||    21 | #pragma message("TBB Warning: tbb/task.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")

I tried...

  1. Using preprocessor pragmas to quiet the warning
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include <pxr/usd/sdf/layer.h>
#pragma GCC diagnostic pop
  1. Defining #define message(ignore) so calls to #pragma message will do nothing instead

Neither approach as worked so far.

Secondarily if the code can be updated to not have these warnings, that'd be also great (hence this GitHub issue to track it).

spiffmon commented 1 month ago

Hi Colin, That warning will go away when building OpenUSD with OneTBB, which we will be delivering support for soon. It will remain for those (like us) who still need to use <OneTBB for awhile.

--spiff

On Sat, Apr 6, 2024 at 10:47 PM Colin Kennedy @.***> wrote:

While working with USD, for as long as I can remember back to USD 19.11, there are warnings when including USD headers. I'd like to ideally have "warnings as errors" -Werror enabled but warnings like these would false positive and prevent builds. I'd like to completely silence them, how can I do that?

.../USD-v24.03-python-3.10.12/include/tbb/task.h|21 col 139| note: ‘#pragma message: TBB Warning: tbb/task.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.’ || 21 | #pragma message("TBB Warning: tbb/task.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")

I tried...

  1. Using preprocessor pragmas to quiet the warning

pragma GCC diagnostic push

pragma GCC diagnostic ignored "-Wdeprecated-declarations"

include <pxr/usd/sdf/layer.h>

pragma GCC diagnostic pop

  1. Trying to #define message(ignore) so calls to #pragma message will do nothing instead

Neither approach as worked so far.

Secondarily if the code can be updated to not have these warnings, that'd be also great (hence this GitHub issue to track it).

— Reply to this email directly, view it on GitHub https://github.com/PixarAnimationStudios/OpenUSD/issues/3035, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOU2DPKRUI2PTJQAELOWLY4DMY3AVCNFSM6AAAAABF3BDS3KVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZDSNJXGY4TANQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jesschimein commented 1 month ago

Filed as internal issue #USD-9546

dillondf commented 1 day ago

I was able to suppress this with: #define TBB_SUPPRESS_DEPRECATED_MESSAGES 1