3 ms·
> 99% of the time, yes. But not always. Hmmm, no, sorry. `NULL` is #defined as `((void )0)`. There is no 99% or other probability involved. Sorry to be so ped
by jsd1982 10y ago
> 99% of the time, yes. But not always.
Hmmm, no, sorry. `NULL` is #defined as `((void )0)`. There is no 99% or other probability involved.
Sorry to be so pedantic as it's kind of an aside to the discussion at hand. I thought perhaps you knew something about NULL in C that I never knew and was eager to be enlightened.
I think you're conflating C pointer `NULL` with the database concept of `NULL` which is not necessarily represented the same way when interfacing with database client APIs.
There's probably a detail you glossed over whereby you're passing 0 vs NULL via separate method calls to the database client API. The distinction cannot be due to literal `NULL` vs. literal `0` purely in C programming terms.
The limitations of C require that database-NULL be represented differently from integral values in terms of data structures. Even if you do pass `NULL` and `0` in the exact same parameter location to the exact same method name, you'd have to ignore a warning about the implicit type conversion from `void ` to `int` and still the semantics do not change and you have no runtime bug as you described.