Thread (20 messages) 20 messages, 10 authors, 2019-02-12

Re: [PATCH 1/3] treewide: Lift switch variables out of switches

From: William Kucharski <hidden>
Date: 2019-01-23 13:22:29
Also in: dri-devel, intel-gfx, intel-wired-lan, linux-fsdevel, linux-kbuild, linux-mm, linux-usb, lkml, netdev

On Jan 23, 2019, at 5:09 AM, Jann Horn [off-list ref] wrote:

AFAICS this only applies to switch statements (because they jump to a
case and don't execute stuff at the start of the block), not blocks
after if/while/... .
It bothers me that we are going out of our way to deprecate valid C constructs
in favor of placing the declarations elsewhere.

As current compiler warnings would catch any reference before initialization
usage anyway, it seems like we are letting a compiler warning rather than the
language standard dictate syntax.

Certainly if we want to make it a best practice coding style issue we can, and
then an appropriate note explaining why should be added to
Documentation/process/coding-style.rst.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help