lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] master 2afd2fe 3/6: Improve concinnity


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master 2afd2fe 3/6: Improve concinnity
Date: Fri, 3 Mar 2017 19:59:44 +0100

On Fri, 3 Mar 2017 15:30:55 +0000 Greg Chicares <address@hidden> wrote:

GC> This is all discussed here...
GC>   file:///home/greg/gwc/style.html
GC> but I guess you don't have /home/greg/ so you can't read it. I could send
GC> you a copy by personal email if you like.

 Yes, please!

GC> I can't publish it as it stands because it quotes some copyrighted
GC> material. There's another reason why I shouldn't publish it now: it's
GC> outdated. For example, it mandates a 'default:' case that triggers a
GC> run-time error, but these days it's better to specify a 'case' for
GC> every enumerator and let the compiler give a compile-time error if any
GC> enumerator was omitted.

 Would you like me to remove the copyrighted and outdated parts and produce
a version suitable for checking in into lmi repository?

GC> Anyway, point 16.10 in that document says: "Surround all case blocks with
GC> {} so that local variables can be declared inside. Even if you don't do
GC> that today, tomorrow someone else will." That's a mistake to which I am
GC> still prone

 I don't really understand what's the problem with doing this: if you do
this, you get a compile-time error and fix it. Why is it such a big deal
that it needs to be specifically guarded against?

 Notice that this is quite different from the situation with "if", where
the danger is that wrong code would be silently compiled and executed
(although gcc 6 -Wmisleading-indentation makes this all but impossible in
practice). With "case", there is no danger of this happening.

VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]