After merging commit c019784b83 (get rid of a 3 more bogus (unsigned long) casts)
(Link to commit for reference: [0] )
I'm now getting compiler warnings like this:
g_editor.c:1884:73: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘struct _glist *’ [-Wformat=] 1884 | snprintf(cbuf, MAXPDSTRING - 2, "pdtk_canvas_setparents .x%lx", c); | ~~^ ~ | | | | | struct _glist * | long unsigned int
.. I presume there's a good reason to change the code (what if "long" is the wrong size?) but I'd like to figure out a way to do it that doesn't throw warnings.
My C has oxidized substantially over time, but I think the p conversion specifier might be the correct thing to use -- if you can live with the additional leading "0x" that is caused by its implied "alternate form" flag, `#`.
From `man snprintf` on Linux / OS X:
""" p The void * pointer argument is printed in hexadecimal (as if by `%#x' or `%#lx'). """
Trying with the current master [1] which includes the commit above, the change from `%lx` to `%p` in lines 1884 and 1891 in `g_editor.c` fixes the warning. (Other warnings/errors remain, and I wouldn't have a clue what to test to check the outcome anyway.)
Best, Albert.
[0] https://github.com/pure-data/pure-data/commit/c019784b83f6638a1c4090ce27e6a0... [1] https://github.com/pure-data/pure-data/commit/364d859aa29c1d42be1d42ad81c74b...