This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, testsuite, tentative] Explicitly disable pointer <-> int cast warnings for avr?
- From: Mike Stump <mikestump at comcast dot net>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- Cc: gcc-patches <gcc-patches at gnu dot org>
- Date: Wed, 20 Jul 2016 10:11:06 -0700
- Subject: Re: [Patch, testsuite, tentative] Explicitly disable pointer <-> int cast warnings for avr?
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
On Jul 19, 2016, at 10:37 PM, Senthil Kumar Selvaraj <email@example.com> wrote:
> The patch fixes a couple of testsuite failures that show up for the
> avr target because it has different sizes for longs and pointers (4
> bytes versus 2), by explicitly disabling the warning for avr.
> Does this make sense?
I don't feel too strongly about it, but it would be nice either to have a cast in the code to the target type to shut it up, or alternatively, use the intptr_t type so that that the sizes are the same. Since this is compile only, a cast would work. As a general rule, if a test case runs, I think we'd need the intptr_t type involved.
Can you give that a try, as then we don't have to have any special flags for any target and the test case is then more portable?
If the edits are too much, your patch is fine. I'm hoping someone reduced the test case and it is small with very few changes required, but I didn't look at the test case.