Warnings from unity

Gary E. Miller gem at rellim.com
Tue Jun 20 20:03:21 UTC 2023


Yo Hal!

On Tue, 20 Jun 2023 12:57:40 -0700
Hal Murray via devel <devel at ntpsec.org> wrote:

> Is anybdy familiar with this area?
> Is this something I did?  Or are others seeing the same problem?
> (I might have turned on some more-warnings flag, but I don't think
> so.)
> 
> ../../tests/unity/unity.c:984:5: warning: enumeration value 
> \u2018UNITY_FLOAT_INVALID_TRAIT\u2019 not handled in switch
> [-Wswitch-enum] ../../tests/unity/unity.c:1124:5: warning:
> enumeration value \u2018UNITY_FLOAT_INVALID_TRAIT\u2019 not handled
> in switch [-Wswitch-enum]

That usually means there is no "default:" case in a switch.

> --------
> 
> Speaking of warnings, some versions of OpenSSL and/or some compilers
> generate this:
> 
> /usr/local/ssl/include/openssl/ssl.h:1491:53: warning: cast discards
> "const" qualifier from pointer target type [-Wcast-qual]

Simple, just a bad cast.  But since it is in a system header, not easy
to fix.

> I've looked into it a bit and don't understand what's going on.  I
> think our code is OK.  This is passing a string literal through a
> maze of macros.  I've decided not to spend much time on this since it
> doesn't happen with newer OpenSSL and/or compilers.

A string literal is (const char *), but you are passing that as a
(char *).  Just be real sure that string is not modified by the called
function.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20230620/9966cbd1/attachment.bin>


More information about the devel mailing list