From: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t*
Date: Tue, 10 Jul 2018 22:58:18 -0300 [thread overview]
Message-ID: <20180711015818.ohiccegpir2mst6h@smtp.gmail.com> (raw)
In-Reply-To: <20180710143826.GC16900@ahiler-mobl1.fi.intel.com>
Hi,
Thanks for the feedback,
I'm just a little bit confused about the next step here. Is it worth to
fix this patch and the others? I got confused since you said that IGT
will remove autotools and some of the warnings here does not appear on
meson.
Best Regards
Rodrigo Siqueira
On 07/10, Arkadiusz Hiler wrote:
> On Tue, Jul 10, 2018 at 03:09:25PM +0100, Chris Wilson wrote:
> > Quoting Arkadiusz Hiler (2018-07-10 14:58:49)
> > > On Sat, Jul 07, 2018 at 08:22:38PM -0300, Rodrigo Siqueira wrote:
> > > > This commit fixes the GCC warning:
> > > >
> > > > warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
> > > > memset(ptr + offsets[0], full_range ? 0x00 : 0x10,
> > > > ^
> > > > warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
> > > > memset(ptr + offsets[1], 0x80,
> > > >
> > > > This commit cast the ptr pointer, which is a void *, to uint32_t * in
> > > > the pointer arithmetic operation.
> > >
> > > This will change semantics, as according to GNU C standard[1], void
> > > pointers have a size of 1 for all arithmetical purposes.
> > >
> > > So you should be using uint8_t (or char) pointer instead.
> >
> > Please just fix the compiler flags, we want close compatibility with the
> > kernel coding standards which explicitly allow void arithmetic for the
> > simplicity it lends to writing code.
> > -Chris
>
> Fair point.
>
> We don't rise the error with meson, so it is not a change in the gcc
> defaults. Somehow autotools manage to end up adding -Wpointer-arith to
> BASE_CFLAGS.
>
> I don't think we should invest time into making autotools behave, since
> it's going to be dropped completely. Hopefully this will happen sooner
> than later.
>
> --
> Cheers,
> Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-07-11 1:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-07 23:22 [PATCH i-g-t 0/7] GCC warning cleanup Rodrigo Siqueira
2018-07-07 23:22 ` [PATCH i-g-t 1/7] Remove parameter aliases with another argument Rodrigo Siqueira
2018-07-10 13:50 ` Arkadiusz Hiler
2018-07-07 23:22 ` [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t* Rodrigo Siqueira
2018-07-10 13:58 ` Arkadiusz Hiler
2018-07-10 14:09 ` [igt-dev] " Chris Wilson
2018-07-10 14:38 ` Arkadiusz Hiler
2018-07-10 14:43 ` Chris Wilson
2018-07-11 1:58 ` Rodrigo Siqueira [this message]
2018-07-07 23:22 ` [PATCH i-g-t 3/7] Fix comparison that always evaluates to false Rodrigo Siqueira
2018-07-07 23:23 ` [PATCH i-g-t 4/7] Fix truncate string in the snprintf Rodrigo Siqueira
2018-07-10 14:07 ` Arkadiusz Hiler
2018-07-07 23:23 ` [PATCH i-g-t 5/7] Make string commands dynamic allocate Rodrigo Siqueira
2018-07-11 12:26 ` Arkadiusz Hiler
2018-07-07 23:23 ` [PATCH i-g-t 6/7] Fix truncate string in the strncpy Rodrigo Siqueira
2018-07-07 23:23 ` [PATCH i-g-t 7/7] Avoid truncate string in __igt_lsof_fds Rodrigo Siqueira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180711015818.ohiccegpir2mst6h@smtp.gmail.com \
--to=rodrigosiqueiramelo@gmail.com \
--cc=arkadiusz.hiler@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).