Re: can't disable pointer-to-int-cast warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Hargett, Matt" <matt.hargett@xxxxxxxxxxxx> writes:

> You're correct, of course. Unfortunately, it only tells me "[enabled by default]", rather than a specific option, so I had to go hunting for warnings that sounded relevant. Is it a bug that GCC didn't tell me what specific option enabled the warning? Or, is it a bug/missing feature that it's an intrinsic warning that can't ever be disabled?

The latter.  There is no way to disable the warning.

> Do you know what option and/or pragma *would* disable the specific warning mentioned above on the code previously sent? I tried -Wno-conversion, and disabling Wconversion via pragma, along with several others. I was hoping for help from gcc-help, after all :)

There isn't one.  Other than -w, which disables all warnings.

> Obviously. In the real example, this is an issue in a variadic argument macro expansion, where there doesn't appear to be a way to explicitly cast each of the individual arguments supplied (beyond the the first) to an intptr_t. Since intptr_t is the same size as pointer on any platform that supports intptr_t, and seems to be generally meant for exactly this scenario, I'm not sure it's useful for GCC to warn when converting pointers/ints to/from intptr_t.

It's always useful to warn about implicitly converting from an integer
to a pointer, or vice-versa.  That is almost always a mistake.  I
understand that your specific case may be the rare exception, although
without seeing the code I don't know why your macro can't add the cast.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux