Looking at this snippet:

+       if (!cn.status) {
                buf = NULL;
+               if (err == 0)           /* keep compiler happy */
+                       buf = NULL;
+       }
        return (buf);
 }

And considering the comment at contrib/bearssl/inc/bearssl_x509.h
<https://github.com/freebsd/freebsd-src/blob/eb33b693b364a4547dfcfd21c159ffc4fb339bc2/contrib/bearssl/inc/bearssl_x509.h#L616>,
is it intended for buf to be returned as-is (i.e., not set to NULL) when
the decoding status indicates an error condition?


On Fri, Jun 30, 2023 at 1:14 PM Simon J. Gerraty <[email protected]> wrote:

> Jessica Clarke <[email protected]> wrote:
> > A conditional assignment of the same value that has already been
> > assigned unconditionally is unidiomatic code generally regarded as a
> > code smell and should be avoided. In an ideal world that would give a
>
> I agree.
>
> I've been bitten by __unused recently when porting stuff to linux
> so was looking to avoid that.
>
>

Reply via email to