rtems_version_control_key() may return NULL

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Sep 2 06:13:43 UTC 2019


On 02/09/2019 08:04, Chris Johns wrote:
> On 2/9/19 3:58 pm, Sebastian Huber wrote:
>> Hello,
>>
>> the
>>
>> const char *rtems_version_control_key( void )
>> {
>> #ifdef RTEMS_VERSION_VC_KEY
>>    return RTEMS_VERSION_VC_KEY;
>> #else
>>    return NULL;
>> #endif
>> }
>>
>> returns NULL, if no RTEMS_VERSION_VC_KEY is defined, e.g. the RTEMS sources are
>> not managed by Git. Naive users like me may produce a NULL pointer if they use
>> it like this printf("version: %s", rtems_version_control_key()). Should we
>> change this function to return "" instead of NULL?
>>
> "NO-VERSION-VC-KEY" ?

I would keep it simple, e.g. strlen(rtems_version_control_key()) == 0 
means, no version control key.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list