I'd like to fix a few warnings but I want to double check the cast.
The warnings come from creating object hex names from pointers. sys_vgui() doesn't trigger this warning, but sprintf() does. For example:
../src/x_text.c:101:31: warning: format specifies type 'unsigned long' but the argument has type 't_textbuf *' (aka 'struct _textbuf *') [-Wformat] sprintf(buf, ".x%lx", x);
Would it be safe to do a cast to (unsigned long)?
sprintf(buf, ".x%lx", (unsigned long)x);
-------- Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
Am 21. Jänner 2022 20:31:57 MEZ schrieb Dan Wilcox danomatika@gmail.com:
Would it be safe to do a cast to (unsigned long)?
sprintf(buf, ".x%lx", (unsigned long)x);
no, because on LLP64 systems, an 'unsigned long' is only 32bit.
there relevant GitHub issue is https://github.com/pure-data/pure-data/issues/1474
mfg.sfg.jfd IOhannes
Ah yes, I remember that issue now. I will leave the warnings in place for now.
On Jan 21, 2022, at 8:42 PM, IOhannes m zmölnig zmoelnig@iem.at wrote:
Am 21. Jänner 2022 20:31:57 MEZ schrieb Dan Wilcox danomatika@gmail.com:
Would it be safe to do a cast to (unsigned long)?
sprintf(buf, ".x%lx", (unsigned long)x);
no, because on LLP64 systems, an 'unsigned long' is only 32bit.
there relevant GitHub issue is https://github.com/pure-data/pure-data/issues/1474
mfg.sfg.jfd IOhannes
-------- Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/