Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: parsing the format string at compile time...
Message-ID: <1989Oct11.171107.22370@utzoo.uucp>
Organization: U of Toronto Zoology
References: <705@nixbur.UUCP> <6737@hubcap.clemson.edu>
Date: Wed, 11 Oct 89 17:11:07 GMT

In article <6737@hubcap.clemson.edu> drcook@hubcap.clemson.edu (david richard cook) writes:
>> printf call is a constant (which it is most of the time), the compiler
>> should be able to parse the string at compile time, and turn the printf
>> call into something like the series of Modula-2 calls...
>
>	If C did allow this, it would not be C.  The compiler knows
>nothing about any functions, including I/O...

This may be true of your compiler, but it is far from universal.  The
C library is part of the language.  It's been that way informally for
a long time (as witness the flak Whitesmiths took over their attempts
to rationalize the library) and is now official (ANSI C).  Such an
optimization is perfectly legitimate.  And no, it doesn't require a
#pragma to enable it.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
