On Wed, 17 Mar 2021 18:37:41 +0100 Denis 'GNUtoo' Carikli <gnu...@cyberdimension.org> wrote:
> When compiling nv-data-md5 under Replicant 6 we have: > hardware/replicant/libsamsung-ipc/tools/nv_data-md5.c: > In function 'main': > hardware/replicant/libsamsung-ipc/tools/nv_data-md5.c:103:1: > error: > control reaches end of non-void function [-Werror=return-type] > } > ^ > cc1: some warnings being treated as errors > > So we simply need to add a return in the error path. > > While we're at it, we use an exit code referenced in sysexits.h > to follow a standard. This can help differentiating between > different types of errors. > > Thanks to that, it can also simplify the code when writing tests. > > Signed-off-by: Denis 'GNUtoo' Carikli <gnu...@cyberdimension.org> > --- > tools/nv_data-md5.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/nv_data-md5.c b/tools/nv_data-md5.c > index e8c9fc8..5edb257 100644 > --- a/tools/nv_data-md5.c > +++ b/tools/nv_data-md5.c > @@ -20,6 +20,7 @@ > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > +#include <sysexits.h> I forgot to add the following in Android.mk: > -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include > +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/tools/include/glibc As I tested with Replicant 6 only before adding sysexits.h (and with guix build after) my tests didn't pick that. Denis.
pgpUHCqgFl_73.pgp
Description: OpenPGP digital signature
_______________________________________________ Replicant mailing list Replicant@osuosl.org https://lists.osuosl.org/mailman/listinfo/replicant