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 15:21:43 -0800 Organization: None to speak of Lines: 31 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="U2FsdGVkX18K2riQ7d/aY91tiwT7X+T5" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:qlUUDk7MMsAGYhjCU9zKvSS16ow= sha1:6zXBd87p1DjRU+YmPpU+5ixmo8c= Xref: csiph.com comp.lang.c:102993 supercat@casperkitty.com 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. Are you talking about having such a call without a visible prototype? In that case, there would still have to be a visible non-prototype declaration -- and the behavior would be undefined. So don't do that. -- 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"