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


Groups > comp.lang.c > #72860

Re: A printf question.

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: A printf question.
Date 2015-10-14 10:26 -0700
Organization None to speak of
Message-ID <lnsi5d8ip3.fsf@kst-u.example.com> (permalink)
References <mvj3b8$i7h$1@dont-email.me> <mvjlns$6ih$1@dont-email.me> <mvkg7v$v5d$1@speranza.aioe.org> <mvkh2q$58k$1@dont-email.me> <1ca6ddab-c513-4095-92df-a81558006ad1@googlegroups.com>

Show all headers | View raw


supercat@casperkitty.com writes:
> On Tuesday, October 13, 2015 at 10:12:32 PM UTC-5, James Kuyper wrote:
>> True - but diagnostics are always permitted....
>
> I've often wondered what the purpose of the parts of the Standard which
> require a diagnostic in some cases, given that there's no requirement that
> an implementation provide any means of determining whether a program is
> found to have any constraint violations.  A compiler which unconditionally
> output "WARNING: This program may contain constraint violations" or even
> "Note: program contained 473 characters" would satisfy the requirements
> but not be any more useful for purposes of noticing constraint violations
> than one that never output any diagnostics.

The standard does not, and probably cannot, require all implementations
to behave sensibly.

It requires at least one diagnostic for any translation unit containing
a violation of any syntax rule or constraint.  A perverse conforming
compiler *could* print just a single diagnostic for every translation
unit and leave it at that, but such a compiler would not be useful.

In practice, it can be difficult to distinguish between required and
optional diagnostics, but with the right options you can usually assume
that any fatal error message denotes a serious problem, and any
non-fatal warning indicates somethuing that you should take a close look
at.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
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"

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


Thread

A printf question. MehdiAmini <atorrses@gmail.com> - 2015-10-13 14:09 +0000
  Re: A printf question. Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-13 10:46 -0400
  Re: A printf question. Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-13 09:19 -0700
    Re: A printf question. Keith Thompson <kst-u@mib.org> - 2015-10-13 10:45 -0700
      Re: A printf question. David Brown <david.brown@hesbynett.no> - 2015-10-13 23:15 +0200
  Re: A printf question. James Kuyper <jameskuyper@verizon.net> - 2015-10-13 15:25 -0400
    Re: A printf question. glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-10-14 02:55 +0000
      Re: A printf question. James Kuyper <jameskuyper@verizon.net> - 2015-10-13 23:12 -0400
        Re: A printf question. supercat@casperkitty.com - 2015-10-14 06:34 -0700
          Re: A printf question. Keith Thompson <kst-u@mib.org> - 2015-10-14 10:26 -0700
        Re: A printf question. MehdiAmini <atorrses@gmail.com> - 2015-10-15 14:06 +0000
          Re: A printf question. James Kuyper <jameskuyper@verizon.net> - 2015-10-15 10:26 -0400
      Re: A printf question. Noob <root@127.0.0.1> - 2015-10-25 23:02 +0100

csiph-web