This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC warnings for unused global variables


Gabriel Dos Reis wrote:

I already quoted Linus on volatile, here is something from someone who
has designed and implemented languages, operating systems and
simulators:

[...] However, I never had strong feeelings about volatile and see
no reason to improve on the ANSI C committee's decisions in this area.
B. Stroustrup, in D&E

Oh, that's nothing. For many a year, the draft Fortran 2000 Standard already contains a "definition" of VOLATILE - or, as the editor of the Standard likes to put it "a standard spelling for indicating non-standard behaviour". Not suprisingly, I caught a subgroup last J3 meeting discussing something that suspiciously looked like "sequence points" because without them, volatile has little meaning.


That's for a language that has been successful without sequence points (or volatile) for half a century.

And no, that's not because no operating systems have ever been written in it. Good ol' Fortran 66 had a splendid way of preventing accesses to memory being "optimized away":

      COMMON /AAP/ MEM
      ...
      FOO = MEM
      CALL DUMSUB
      FOO = MEM
      ...
      END

As whatever DUMSUB does to MEM is outside the scope of the "processor" (compiler/runtime/cpu in Fortran Standardese) this effectively causes the MEM access to be performed twice.

[ and don't complain about the cost of a subroutine call - in comparison
  with memory access times that's negligible ]

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]