Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #17682

Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets?

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets?
Date 2012-02-20 10:33 -0800
Organization None to speak of
Message-ID <lnty2lcq2l.fsf@nuthaus.mib.org> (permalink)
References <jhp83t$3un$1@speranza.aioe.org> <lnobsveofu.fsf@nuthaus.mib.org> <jhqkco$g1$1@speranza.aioe.org> <bd3798a2-90a4-4be6-a2c4-d097594f100a@b23g2000yqn.googlegroups.com> <0.ee91c1f1976309150aa7.20120220132552GMT.87k43htz4v.fsf@bsb.me.uk>

Show all headers | View raw


Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> Nick Keighley <nick_keighley_nospam@hotmail.com> writes:
>> On Feb 19, 10:54 am, Lord Voldermort <nos...@nospam.com> wrote:
>>> So is there any translation program then to take code for the previous
>>> standard and upgrade it to work with C11 (replace gets by fgets etc)?
>>
>> fgets() isn't a straight replacement for gets(). The end-of-line
>> handling is different. I also suspect the "translation program" would
>> have to read your mind in some cases in order to get the buffer size
>> right for fgets(). Do you use gets() a lot, or use programs that do?
>
> If you simply must get your gets-containing code to run today, you can use:
>
> #define gets(s) (scanf("%[^\n]%*c", (s)) == 1 ? (s) : NULL)
>
> but you should fix it tomorrow!  (Not you personally, of course, but
> "one" is sometimes too formal for Usenet).

If you simply must get such code running *today*, you can just
leave the gets() call in place.  I don't believe there are yet any
hosted C implementations that don't provide it.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
    Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Lord Voldermort <nospam@nospam.com> - 2012-02-18 22:18 +0000
  Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Lord Voldermort <nospam@nospam.com> - 2012-02-18 22:36 +0000
    Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-02-18 22:55 +0000
    Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Kaz Kylheku <kaz@kylheku.com> - 2012-02-19 06:05 +0000
  Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Keith Thompson <kst-u@mib.org> - 2012-02-18 15:01 -0800
    Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Lord Voldermort <nospam@nospam.com> - 2012-02-19 10:54 +0000
      Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-02-19 12:21 +0000
        Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Lord Voldermort <nospam@nospam.com> - 2012-02-19 19:53 +0000
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Keith Thompson <kst-u@mib.org> - 2012-02-19 12:15 -0800
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Geoff <geoff@invalid.invalid> - 2012-02-19 13:58 -0800
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Stephen Sprunk <stephen@sprunk.org> - 2012-02-19 17:19 -0600
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? James Kuyper <jameskuyper@verizon.net> - 2012-02-19 18:41 -0500
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Robert Wessel <robertwessel2@yahoo.com> - 2012-02-20 01:51 -0600
            Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Keith Thompson <kst-u@mib.org> - 2012-02-20 02:19 -0800
      Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 00:45 -0800
      Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 00:52 -0800
        Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-02-20 13:25 +0000
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Keith Thompson <kst-u@mib.org> - 2012-02-20 10:33 -0800
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2012-02-21 19:51 +0000
            Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? James Kuyper <jameskuyper@verizon.net> - 2012-02-21 15:11 -0500
              Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Jens Gustedt <jens.gustedt@loria.fr> - 2012-02-22 08:35 +0100
                Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? Keith Thompson <kst-u@mib.org> - 2012-02-22 02:18 -0800
          Re: Has Implicit Int been disabled in the new C11 standard? What about other previously depreciated constructions eg gets? David Thompson <dave.thompson2@verizon.net> - 2012-03-01 05:57 -0500

csiph-web