From: Selva N. <sel...@gm...> - 2017-12-03 16:15:31
|
Hi Simon, IIRC, this patch is waiting for a new version to take care of the static const as agreed below: On Thu, Nov 9, 2017 at 11:12 AM, Selva <sel...@gm...> wrote: > Hi Simon, > > On Thu, Nov 9, 2017 at 3:33 AM, Simon Rozman <si...@ro...> wrote: > >> Hi, >> >> > But then making the variable static just to keep a valid pointer beyond >> the >> > current block local looks like a kludge. For me seeing static applied >> to a >> > variable scoped to a block is just confusing and unusual style. Think >> of this: if >> > you remove that static the code may still build and even work on some >> > compilers depending on optimization level etc. and mysteriously fail on >> some >> > occasions. From that one could either conclude a static qualifier is >> required >> > her or the variable is wrongly scoped. I think the latter conclusion is >> the 'right' >> > one and static is a misuse. >> > >> > As for the combination 'static const ...', it has a place and that is >> for constants >> > defined outside functions to limit the scope of an otherwise global >> const to >> > that of the compilation unit. >> > >> > It may be just me. >> >> Not necessarily. It may be just *me*. :) >> >> Anyway, you got me convinced and I shall move those structs from data >> segment to stack in the next version of the patch. > > > Glad that I don't have to invent an Acked-with-reservations: tag :) > I suppose a v4 is coming. Thanks, Selva |