[igt-dev] [PATCH v2] tests/i915_pm_rpm: improved strictness and verbosity of i2c subtest

Ville Syrjälä ville.syrjala at linux.intel.com
Mon Jun 17 13:26:45 UTC 2019


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?

-- 
Ville Syrjälä
Intel


More information about the igt-dev mailing list