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


Groups > comp.lang.c > #41375

Re: complex declarations

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: complex declarations
Date 2014-03-05 07:29 -0500
Organization A noiseless patient Spider
Message-ID <lf75b0$au$1@dont-email.me> (permalink)
References <lf5cdv$dll$1@dont-email.me> <53163C3C.8060203@verizon.net> <lf5hca$oqi$1@dont-email.me> <lnob1lwrgy.fsf@nuthaus.mib.org> <lf6qd4$m55$1@dont-email.me>

Show all headers | View raw


On 03/05/2014 04:22 AM, Robbie Brown wrote:
> On 04/03/14 22:04, Keith Thompson wrote:
>> Robbie Brown <dac@nomail.invalid> writes:
>>> On 04/03/14 20:49, James Kuyper wrote:
>>>> On 03/04/2014 03:18 PM, Robbie Brown wrote:
>>>>> I have the following code
> 
> <snip>
> 
>> Use "gcc -std=c99 -pedantic" to make it warn about violations of the C99
>> standard.  gcc is not a conforming C compiler without the "-pedantic"
>> option.  Use "-pedantic-warnings" to turn those warnings into fatal
>> errors.
> 
> OK, well my gcc doesn't support -pedantic-warnings.

I'm pretty sure that was a typo for -pedantic-errors

> However
> 
> -pedantic warns and still produces an executable
> -pedantic-errors produces an error message and does not produce an 
> executable, so I guess it's the same difference.

I don't usually bother with -pedantic-errors, but there is a real
benefit to using it:  if there is no executable, you can't be tempted to
try executing it.

> It's a bit of a minefield though isn't it?
> 
> Now I know there's no such thing but
> Does the 'average C developer' actually need to know all this all the 
> time or do people often/sometimes 'specialize' in a particular compiler 
> implementation along with it's extensions?

Most people specialize in some way - my personal choice was to
specialize in writing to the C standard, avoiding compiler-specific
extensions, but that's mainly because my company's client has imposed a
strong portability requirements on our code. You should be able to
compile and successfully execute our code on any system with sufficient
memory and disk space that supports POSIX (1003.1, IIRC) and C95. you
might have to make minor modifications to the make file, but you
shouldn't have to do anything to the source code to make it work. I
avoid even depending upon POSIX unless necessary. Some of my code relies
on POSIX's guarantee that CHAR_BIT == 8; but most of it would continue
to work properly even if that weren't true.

People writing code that has weaker portability requirements can and
usually do justify learning more about the quirks of a particular
compiler than I ever have.
-- 
James Kuyper

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


Thread

complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-04 20:18 +0000
  Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 15:49 -0500
    Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 16:06 -0500
      Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 12:18 +0000
        Re: complex declarations "BartC" <bc@freeuk.com> - 2014-03-05 12:56 +0000
          Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-05 08:24 -0500
            Re: complex declarations "BartC" <bc@freeuk.com> - 2014-03-05 16:26 +0000
        Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-05 08:13 -0500
          Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 13:32 +0000
        Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 14:32 +0000
    Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-04 21:42 +0000
      Re: complex declarations Keith Thompson <kst-u@mib.org> - 2014-03-04 14:04 -0800
        Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 09:22 +0000
          Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-05 07:29 -0500
            Re: complex declarations Keith Thompson <kst-u@mib.org> - 2014-03-05 08:38 -0800
      Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 17:05 -0500
  Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-04 21:15 +0000
    Re: complex declarations "BartC" <bc@freeuk.com> - 2014-03-04 21:38 +0000
      Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-04 23:27 +0000
    Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-04 21:59 +0000
      Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 17:12 -0500
      Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 00:28 +0000
        Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 09:10 +0000
          Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 11:44 +0000

csiph-web