Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #136755
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <kst-u@mib.org> |
| Newsgroups | comp.lang.c |
| Subject | Re: Unwanted, implicit type conversion to a pointer when a value is zero? |
| Date | Sat, 13 Oct 2018 12:57:42 -0700 |
| Organization | None to speak of |
| Lines | 27 |
| Message-ID | <lntvlpvcuh.fsf@kst-u.example.com> (permalink) |
| References | <eaf12c90-58a9-4a8f-b12f-4c0f79a50c59@googlegroups.com> <G9nwD.18529$I34.17228@fx43.am4> <lny3b1vgjz.fsf@kst-u.example.com> <9BrwD.83978$522.7751@fx35.am4> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | reader02.eternal-september.org; posting-host="ecf70ef72d5384f9de22a1e55ca04a4a"; logging-data="28924"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18k8+tfzz+m+z6R4tLa8Rpi" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:2p+V1K6UEfz6lRVmzxEoadDM2uA= sha1:LlpdbKqz50B1WNQaNIiZSdgYuA8= |
| Xref | csiph.com comp.lang.c:136755 |
Show key headers only | View raw
Bart <bc@freeuk.com> writes:
> On 13/10/2018 19:37, Keith Thompson wrote:
[...]
>> The OP already said that he knows it's an error.
>
> Which one, the 00, or the 01? They said they thought both were errors.
Yes. Both are logical errors. Only the 0x01 was diagnosed by the
compiler.
> He's asking why the
>> error was diagnosed for 0x01 but not for 0x00 (and that's been
>> answered).
>
> Who by, apart from me? I don't think anyone said anything about the 01
> value.
The 0x01 error was diagnosed by the compiler, because 0x01 cannot be
implicitly converted to a pointer type. The OP showed us the error
message. Several others have explained why the 0x00 logical error was
not diagnosed (because it's a null pointer constant).
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
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"
Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread
Unwanted, implicit type conversion to a pointer when a value is zero? jladasky@itu.edu - 2018-10-12 17:12 -0700
Re: Unwanted, implicit type conversion to a pointer when a value is zero? David Brown <david.brown@hesbynett.no> - 2018-10-13 12:54 +0200
Re: Unwanted, implicit type conversion to a pointer when a value is zero? Keith Thompson <kst-u@mib.org> - 2018-10-13 11:36 -0700
Re: Unwanted, implicit type conversion to a pointer when a value is zero? Bart <bc@freeuk.com> - 2018-10-13 15:19 +0100
Re: Unwanted, implicit type conversion to a pointer when a value is zero? Keith Thompson <kst-u@mib.org> - 2018-10-13 11:37 -0700
Re: Unwanted, implicit type conversion to a pointer when a value is zero? Bart <bc@freeuk.com> - 2018-10-13 20:21 +0100
Re: Unwanted, implicit type conversion to a pointer when a value is zero? Keith Thompson <kst-u@mib.org> - 2018-10-13 12:57 -0700
csiph-web