[cfe-dev] -Wdisabled-macro-expansion warning with setjmp()

Sean McBride via cfe-dev cfe-dev at lists.llvm.org
Fri Feb 19 07:18:08 PST 2016


Hi all,

This reduced/trivial C++ snippet:

----------
#include <setjmp.h>

int main()
{
  setjmp(0);
  return 0;
}
----------

gives:

/Users/sean/test.cxx:5:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  setjmp(0);
  ^
/Users/sean/llvm/llvm-rel-install/bin/../include/c++/v1/setjmp.h:40:21: note: expanded from macro 'setjmp'
#define setjmp(env) setjmp(env)
                    ^

(If I use a .c file, I don't get the warning.)

As that's an llvm header, I would hope not to get this warning.  The file has '#pragma GCC system_header', which I thought would prevent a warning.  Is it a bug that I get this warning?

Thanks,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the cfe-dev mailing list