[cmake-developers] Questions about coding conventions

Ben Boeckel ben.boeckel at kitware.com
Mon Jun 13 13:34:48 EDT 2016


On Mon, Jun 13, 2016 at 16:14:51 +0200, Daniel Pfeifer wrote:
> On Mon, Jun 13, 2016 at 2:09 PM, Ben Boeckel <ben.boeckel at kitware.com> wrote:
> > Usually NULL means "unset". See properties,
> > variable values, etc. As an output, any place which doesn't care should
> > already be using GetSafeDefinition().
> 
> I know that, at the moment, NULL is used for "unset" in many places. I
> am trying to figure out whether we could theoretically use "empy" to
> mean "unset".
> If there is a case where we distinguish between null and empty, this
> will not be possible.

And I'm saying that looking to port to GetSafeDefinition() will
highlight those that *can't* be converted easily which will get you use
cases for the current split.

> > As a concrete example, `set(CACHE)` cares about NULL versus *s == NULL:
> 
> Thanks for the example. I found the check for `s != NULL` in the
> second line. Can you help me finding the check for `*s == NULL`?

There isn't, hence the difference in behavior between NULL and empty.

--Ben


More information about the cmake-developers mailing list