-Wcast-qual Re: [PATCHES v4] Another round of FreeBSD developer build fixes

Timur I. Bakeyev timur at freebsd.org
Sun Nov 26 03:21:57 UTC 2017


Uri, thanks again for your patches and work. I managed finally to compile
HEAD with --picky-developer with only few uncommitted patches.

So, we still need: [PATCH 01/24] sysacls: make SMB_ACL_PERMSET_T opaque

Without it compilation fails with:

../source3/lib/sysacls.c:98:13: error: incompatible pointer types assigning
to 'SMB_ACL_PERMSET_T' (aka 'unsigned short *') from 'uint32_t *' (aka
'unsigned int *')
      [-Werror,-Wincompatible-pointer-types]
        *permset_p = &entry_d->a_perm;
                   ^ ~~~~~~~~~~~~~~~~
1 error generated.

But that's was already known.

pam_wrapper seems didn't need the "[PATCH v4 10/13] pam_wrapper: use
uintptr_t as base for const-discarding", at least for FreeBSD, as both are
detected:
#define HAVE_INTPTR_T 1
#define HAVE_UINTPTR_T 1

What is missing is smth. like:

--- third_party/pam_wrapper/libpamtest.h.orig      2017-11-26
03:55:52.608871000 +0100
+++ third_party/pam_wrapper/libpamtest.h   2017-11-26 03:56:07.925369000
+0100
@@ -21,6 +21,7 @@

 #include <stdint.h>
 #include <security/pam_appl.h>
+#include "config.h"

 /**
  * @defgroup pamtest The pamtest API


And last, but not least set of errors that pop up are related to
pam_winbind:

../nsswitch/pam_winbind.c:201:16: error: format string is not a string
literal [-Werror,-Wformat-nonliteral]
                vsyslog(err, format, args);
                             ^~~~~~
../nsswitch/pam_winbind.c:205:15: error: format string is not a string
literal [-Werror,-Wformat-nonliteral]
        vsyslog(err, format2, args);
                     ^~~~~~~
../nsswitch/pam_winbind.c:722:24: error: format string is not a string
literal [-Werror,-Wformat-nonliteral]
        ret = vasprintf(&var, format, args);
                              ^~~~~~
3 errors generated.

Two of them are easily fixable with:
--- nsswitch/pam_winbind.c.orig    2017-11-25 14:13:23.000000000 +0100
+++ nsswitch/pam_winbind.c 2017-11-26 03:41:50.271660000 +0100
@@ -175,6 +175,11 @@ static inline void textdomain_init(void)

 /* some syslogging */

+static void _pam_log_int(const pam_handle_t *pamh,
+                        int err,
+                        const char *format,
+                        va_list args) PRINTF_ATTRIBUTE(3,0);
+
 #ifdef HAVE_PAM_VSYSLOG
 static void _pam_log_int(const pam_handle_t *pamh,
                         int err,
@@ -714,6 +719,11 @@ static int _make_remark(struct pwb_conte
 static int _make_remark_v(struct pwb_context *ctx,
                          int type,
                          const char *format,
+                         va_list args) PRINTF_ATTRIBUTE(3,0);
+
+static int _make_remark_v(struct pwb_context *ctx,
+                         int type,
+                         const char *format,
                          va_list args)
 {
        char *var;


But not the one on line 205.

With regards,
Timur Bakeyev.


On Sat, Nov 25, 2017 at 2:52 PM, Uri Simchoni <uri at samba.org> wrote:

> On 11/25/2017 02:02 PM, Stefan Metzmacher wrote:
> >>>> I would like some broader comment on:
> >>>>
> >>>> [PATCH v4 08/13] build: remove -Wcast-align from developer build
> >
> > Please don't remove -Wcast-align! The following should allow the build:
> >
> > ADDITIONAL_CFLAGS="-Wno-error=cast-align" ./configure.developer
> > --picky-developer
> >
> It's possible of course. My aim has been to succeed without having to
> add flags for a native build on a rather mainstream OS.
>
> I would appreciate some reasoning added to not removing this flag, esp
> after I've explained in a rather longish way why IMO this flag either
> does nothing, or breaks the build (depending on platform).
>
> > We use something similar with -Wno-error=deprecated-declarations.
> >
> > metze
> >
>
> Andrew, Re: what misalignment causes - on Linux it's configurable
> through /proc/cpu/alignment, and there's an option for the kernel to fix
> it up. In ARM/MIPS projects I was involved with, we would set it to send
> a SIGBUG, not wanting to live with broken code.
>
> Thanks,
> Uri.
>


More information about the samba-technical mailing list