lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 10 Feb 2021 15:20:53 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'John Garry' <john.garry@...wei.com>,
        Jianlin Lv <Jianlin.Lv@....com>,
        "will@...nel.org" <will@...nel.org>,
        "mathieu.poirier@...aro.org" <mathieu.poirier@...aro.org>,
        "leo.yan@...aro.org" <leo.yan@...aro.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "acme@...nel.org" <acme@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "jolsa@...hat.com" <jolsa@...hat.com>,
        "namhyung@...nel.org" <namhyung@...nel.org>,
        "irogers@...gle.com" <irogers@...gle.com>,
        "agerstmayr@...hat.com" <agerstmayr@...hat.com>,
        "kan.liang@...ux.intel.com" <kan.liang@...ux.intel.com>,
        "adrian.hunter@...el.com" <adrian.hunter@...el.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] perf tools: Fix arm64 build error with gcc-11

...
> > @@ -691,6 +691,7 @@ static int regs_map(struct regs_dump *regs, uint64_t mask, char *bf, int size)
> >   {
> >   	unsigned int i = 0, r;
> >   	int printed = 0;
> > +	const char *reg_name;
> >
> >   	bf[0] = 0;
> >
> > @@ -700,9 +701,10 @@ static int regs_map(struct regs_dump *regs, uint64_t mask, char *bf, int size)
> >   	for_each_set_bit(r, (unsigned long *) &mask, sizeof(mask) * 8) {
> 
> a good practice is to limit scope of variables as much as possible, so
> reg_name could be declared here

I'd go for either function scope or a very small inner block
(like this one).

Otherwise it gets very difficult for the average human (or other
intelligent being) to locate the definition.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ