How to prevent warnings

  • Found this while tracking down a compiler warning where the warning didn't match the source code:

    	/* math.h defines prototypes for j0, j1, jn, y0, y1 and yn which 
    	   gives us warnings with the -Wshadow option of gcc */
    #	define j0	jjjjjj0
    #	define j1	jjjjjj1
    #	define jn	jjjjjjn
    #	define y0	yyyyyy0
    #	define y1	yyyyyy1
    #	define yn	yyyyyyn

  • These are XOPEN (POSIX 2001) Bessel functions. Frankly, the workaround used is not all that bad. I suppose it could be better to ban those names from being used as variable or function names.

Log in to reply

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.