Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.unix.programmer,comp.lang.c Subject: Re: Odd compiler behaviour? Date: Tue, 01 Mar 2016 10:55:19 -0800 Organization: None to speak of Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="31059"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ebDZa1nfLnieFJ4bcPdCJ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:sC3sq/WwHboTrN6oz41K9jVzH90= sha1:Prq+xinYxGaz1moMfaRDxYpNemA= Xref: csiph.com comp.unix.programmer:7975 comp.lang.c:82884 spud@potato.field writes: > On Tue, 01 Mar 2016 08:51:46 -0800 > Keith Thompson wrote: >>spud@potato.field writes: [...] >>> Its an easy way to get user input in a simple example to demonstrate that the >>> output from printf can't possibly be computed at compile time since the user >>> enters the shift value at runtime. >> >>Ok. Using gets() obscured the point you were making. It's not merely > > Obscured it or you just didn't read the code properly? Possibly both. You posted code and didn't say anything about it. The call to gets() was the first thing that jumped out at me. >>unsafe; it's been removed from the language as of the 2011 standard. > > TBH I doubt many people care much about C standards past 1999. C++ leads the > way these days I'm afraid. It's been deprecated longer than that -- and if you want comp.lang.c++ (or comp.lang.c++.moderated, or comp.std.c++) you know where to find it. In any case, several major C compilers, including gcc and clang, have implemented large parts of C11. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"