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


Groups > comp.lang.c > #150351

Re: Concerning the necessity of include guards

From Anton Shepelev <anton.txt@gmail.com>
Newsgroups comp.lang.c
Subject Re: Concerning the necessity of include guards
Date 2020-02-29 13:28 +0300
Organization A noiseless patient Spider
Message-ID <20200229132854.5f5df09e2fb5a8fde7daab60@gmail.com> (permalink)
References (2 earlier) <r31fnc$t6b$1@dont-email.me> <20200225141351.8b50facbd1498ce2848f12a1@g{oogle}mail.com> <r332f7$fe6$1@dont-email.me> <20200229011411.54de128ce87d9a3d980f22e4@gmail.com> <ZBg6G.370078$LY2.321760@fx23.am4>

Show all headers | View raw


Bart to Anton Shepelev:

> > From what you and others have written in this thread, it
> > seems to me that C would be better if it implied an
> > include guard by default for each header, letting the
> > programmer occasionally to resort to the current
> > behavior of C in the very rare cases when it is desired.
>
> You might need a guard for an actual header. But not
> necessarily for an include file that is designed to be
> included multiple times in a source file.
>
> C can't tell what is a header, and what is just an include
> file.

But the programmer can.  And since, in your terminology, the
majority of include files are headers, single inclusion
should be the default behavior, and multiple inclusion a
special case needing explicit indication. Ergonomy requires
that the most frequest use shall be the simplest, shortest,
and defaultest.

-- 
()  ascii ribbon campaign -- against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

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


Thread

Concerning the necessity of include guards Anton Shepelev <anton.txt@gmail.com> - 2020-02-24 22:08 +0300
  Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-24 20:28 +0100
  Re: Concerning the necessity of include guards Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-24 19:40 +0000
    Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-24 22:37 +0100
      Re: Concerning the necessity of include guards Anton Shepelev <anton.txt@g{oogle}mail.com> - 2020-02-25 14:13 +0300
        Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 13:03 +0100
          Re: Concerning the necessity of include guards Anton Shepelev <anton.txt@gmail.com> - 2020-02-29 01:14 +0300
            Re: Concerning the necessity of include guards Bart <bc@freeuk.com> - 2020-02-28 22:36 +0000
              Re: Concerning the necessity of include guards Anton Shepelev <anton.txt@gmail.com> - 2020-02-29 13:28 +0300
            Re: Concerning the necessity of include guards Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-02-29 00:08 +0000
            Re: Concerning the necessity of include guards Richard Damon <Richard@Damon-Family.org> - 2020-02-29 07:05 -0500
            Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-03-01 15:01 +0100
  Re: Concerning the necessity of include guards Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-02-24 14:52 -0500
    Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-24 21:19 +0100
      Re: Concerning the necessity of include guards Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-02-24 15:48 -0500
        Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-24 21:53 +0100
          Re: Concerning the necessity of include guards Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-02-24 17:26 -0500
            Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 00:08 +0100
              Re: Concerning the necessity of include guards Thiago Adams <thiago.adams@gmail.com> - 2020-02-24 15:24 -0800
                Re: Concerning the necessity of include guards Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-02-24 22:20 -0800
                Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 09:52 +0100
            Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-25 08:12 +0100
              Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 09:55 +0100
                Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-25 10:35 +0100
                Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 13:13 +0100
                Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-25 13:50 +0100
                Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 18:33 +0100
                Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-25 18:38 +0100
                Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 18:42 +0100
                Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-25 18:46 +0100
                Re: Concerning the necessity of include guards Bart <bc@freeuk.com> - 2020-02-25 19:35 +0000
                Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 21:18 +0100
                Re: Concerning the necessity of include guards Bonita Montero <Bonita.Montero@gmail.com> - 2020-02-26 06:40 +0100
                Re: Concerning the necessity of include guards James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-25 12:12 -0800
                Re: Concerning the necessity of include guards James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-25 11:55 -0800
                Re: Concerning the necessity of include guards David Brown <david.brown@hesbynett.no> - 2020-02-25 21:37 +0100
                Re: Concerning the necessity of include guards scott@slp53.sl.home (Scott Lurndal) - 2020-02-26 02:39 +0000
                Re: Concerning the necessity of include guards Real Troll <real.troll@trolls.com> - 2020-02-25 23:10 -0400
                Re: Concerning the necessity of include guards chad <cdalten@gmail.com> - 2020-02-27 05:39 -0800
  Re: Concerning the necessity of include guards Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-02-24 22:23 +0000
  Re: Concerning the necessity of include guards Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-02-24 21:17 -0800
    Re: Concerning the necessity of include guards Guillaume <message@bottle.org> - 2020-02-25 13:03 +0100

csiph-web