Created attachment 16275 [details] Patch to lib/util/debug.c When building 4.10.18 on Solaris 10/11 with the vendor C compiler, the following error is reported: [ 454/3077] Compiling lib/util/debug.c 12:25:55 runner ['c99', '-D_SAMBA_BUILD_=4', '-DHAVE_CONFIG_H=1', '-mr', '-Qn', '-xstrconst', '-xO2', '-xtarget=ultra2', '-m32', '-xarch=sparcvis', '-D__EXTENSIONS__', '-D_STDC_C99=1', '-D_XPG6=1', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '-DHAVE_CONFIG_H=1', '-KPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_REENTRANT', '-DSTATIC_samba_debug_MODULES=NULL', '-DSTATIC_samba_debug_MODULES_PROTO=extern void __samba_debug_dummy_module_proto(void)', '-Iinclude/public', '-I../../include/public', '-Isource4', '-I../../source4', '-Ilib', '-I../../lib', '-Isource4/lib', '-I../../source4/lib', '-Isource4/include', '-I../../source4/include', '-Iinclude', '-I../../include', '-Ilib/replace', '-I../../lib/replace', '-I.', '-I../..', '-Ilib/talloc', '-I../../lib/talloc', '../../lib/util/debug.c', '-c', '-o', '/opt/build/samba-4.10.18/bin/default/lib/util/debug.c.9.o', '-I/opt/TWWfsw/gettext018/include', '-I/opt/TWWfsw/libarchive31/include', '-I/opt/TWWfsw/libgcrypt15/include', '-I/opt/TWWfsw/libgnutls212/include', '-I/opt/TWWfsw/libgpgerror111/include', '-I/opt/TWWfsw/libiconv113/include', '-I/opt/TWWfsw/libgpgme14/include', '-I/opt/TWWfsw/libjansson212/include', '-I/opt/TWWfsw/liblmdb09/include', '-I/opt/TWWfsw/libz12/include', '-I/opt/TWWfsw/openldap24/include'] "../../lib/talloc/talloc.h", line 1058: warning: attribute "deprecated" is unknown, ignored "../../lib/talloc/talloc.h", line 1924: warning: attribute "deprecated" is unknown, ignored "../../lib/util/debug.c", line 163: non-constant initializer: op "NAME" c99: acomp failed for ../../lib/util/debug.c In lib/util/debug.c, we have: static struct debug_class debug_class_list_initial[ARRAY_SIZE(default_classname_ table)] = { [DBGC_ALL] = (struct debug_class) { .fd = 2 }, }; Removing (struct debug_class) fixes the compile issue.
amzaingly that compiler does not even support the deprecated attribute. Current versions of the studio compiler do support that as far as I know. Which version do you have there? I actually think that you should update the compiler, that will probably also make it accept modern struct assignments then.
This bug was referenced in samba master: 2889baeec4a1c66a1ffd78469ed916e3b292f4d0 de748864201167ac1b4ecf4f121fbe2b110103e5 c56c5c17fd4f5764935ee6a4cd90b9c0a2c525b4
This bug was referenced in samba master: bbfd93f7b6322b41cb69a0bab4903d074f3c60b7
this fixed in master and for 4.14 (along with many other studio compiler related fixes)