Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #136755

Re: Unwanted, implicit type conversion to a pointer when a value is zero?

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 2018-10-13 12:57 -0700
Organization None to speak of
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>

Show all headers | 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


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