Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Preprocessor Overheads Date: Thu, 02 Feb 2017 16:13:18 -0800 Organization: None to speak of Lines: 34 Message-ID: References: <6f4a3c6f-a81e-4b75-9be6-67e07f6584af@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="abc513047bd7eb6502f52aab060309cd"; logging-data="7421"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196mdk6TuotdU0778Oe3zeb" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:w7WR76Cmjg4Pn1Hq9qVeJtRwloQ= sha1:3EFRwgiauZO/WWlNIdvgar0iPFM= Xref: csiph.com comp.lang.c:102997 supercat@casperkitty.com writes: > On Thursday, February 2, 2017 at 5:20:49 PM UTC-6, Keith Thompson wrote: >> supercat writes: >> [...] >> > The Standard could have specified that, but having rules which >> > guaranteed behavior on some platforms but not others might have been >> > seen as reflecting negatively on the platforms that worked >> > differently--something the authors of the Standard seem to have bent >> > over backward to avoid doing. The dominant case by far where code >> > would rely upon such behavior would be when passing a pointer of a >> > particular type to a function which expects a void*, which would be >> > permissible without a cast in cases where the prototype is in scope. >> [...] >> >> What? In such cases the pointer is converted. >> >> void func(void *param); >> >> int *p = NULL; >> func(p); >> >> The value of p is converted from int* to void*. On some systems, that >> conversion is trivial; on others it might not be. > > In the days before prototypes, [...] We are no longer in the days before prototypes. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"