From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Vasilev, Oleg" <oleg.vasilev@intel.com>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH v2] tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest
Date: Mon, 17 Jun 2019 17:09:06 +0300 [thread overview]
Message-ID: <20190617140906.GJ5942@intel.com> (raw)
In-Reply-To: <20190617134021.GU22949@platvala-desk.ger.corp.intel.com>
On Mon, Jun 17, 2019 at 04:40:21PM +0300, Petri Latvala wrote:
> On Mon, Jun 17, 2019 at 04:26:45PM +0300, Ville Syrjälä wrote:
> > On Mon, Jun 17, 2019 at 10:05:29AM +0000, Vasilev, Oleg wrote:
> > > Hi,
> > >
> > > Thank you for the review. I've sent an updated patch.
> > >
> > > On Fri, 2019-06-14 at 18:30 +0300, Ville Syrjälä wrote:
> > > > On Thu, Jun 13, 2019 at 04:06:23PM +0300, Oleg Vasilev wrote:
> > > > >
> > > > > +static void format_hex_string(unsigned char edid[static
> > > > > EDID_LENGTH],
> > > > > + char buf[static EDID_LENGTH * 5 + 1])
> > > >
> > > > What's the deal with those 'static's?
> > >
> > > This enforces an array size to be at least EDID_LENGTH.
> > >
> > > https://hamberg.no/erlend/posts/2013-02-18-static-array-indices.html
> >
> > Interesting. Ugly, but interesting.
> >
> > Doesn't look like gcc cares about this at all though. I doesn't even
> > care if I do silly things like:
> >
> > int foo(int x[static 8])
> > {
> > return x[20];
> > }
> >
> > I guess clang is better?
>
> The 8 means there's at least 8 elements, it doesn't restrict there being more.
Ah, yes. That was a bad example. But it doesn't warn if I call it
with an array smaller than the 8 elemets either.
>
> And it's mostly for the call site. Try calling foo(NULL) now.
No warnings.
So unless there's a new -W knob for this which isn't part of -Wall
-Wextra this seems pointless with gcc (well, at least gcc 8.3).
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-06-17 14:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 13:06 [igt-dev] [PATCH v2] tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest Oleg Vasilev
2019-06-13 16:14 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest (rev3) Patchwork
2019-06-14 15:30 ` [igt-dev] [PATCH v2] tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest Ville Syrjälä
2019-06-17 10:05 ` Vasilev, Oleg
2019-06-17 13:26 ` Ville Syrjälä
2019-06-17 13:40 ` Petri Latvala
2019-06-17 14:09 ` Ville Syrjälä [this message]
2019-06-17 14:22 ` Ser, Simon
2019-06-15 3:45 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest (rev3) Patchwork
2019-06-17 10:03 ` [igt-dev] [PATCH v3] tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest Oleg Vasilev
2019-06-17 13:26 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest (rev4) Patchwork
2019-06-17 18:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-06-19 8:58 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest (rev3) Patchwork
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=20190617140906.GJ5942@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=oleg.vasilev@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.