Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Problems maintaining header files Message-ID: <587@taumet.com> Date: 5 Feb 91 17:36:01 GMT References: <15917@reed.UUCP> <6107@stpstn.UUCP> <3707@lupine.NCD.COM> Organization: Taumetric Corporation, San Diego Lines: 24 rfg@NCD.COM (Ron Guilmette) writes: >Also note that `#pragma once' is likely to be portable to all existing >ANSI C environments because ANSI C requires that ANSI C preprocessors >*must* ignore all #pragmas that they do not understand. Well, it's portable only in the degenerate sense that a compiler won't complain if it doesn't recognize #pragma once. It might merely do something unintended and possibly harmful. Consider these cases: 1. The file must not be included more than once but #pragma once is ignored. 2. #pragma once means something entirely different to a particular compiler (such as turn on Customer Engineer features, which can be turned off with #pragma offce). If you want to port programs to different environments, don't rely on nonstandard features. -- Steve Clamage, TauMetric Corp, steve@taumet.com