Bug 8226 - build failure on initializing union member in declaration
Summary: build failure on initializing union member in declaration
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.6.0rc2
Hardware: All FreeBSD
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-13 18:47 UTC by Herb Lewis
Modified: 2011-06-17 19:06 UTC (History)
1 user (show)

See Also:
bjacke: review+


Attachments
proposed fix (1.79 KB, patch)
2011-06-13 18:47 UTC, Herb Lewis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Herb Lewis 2011-06-13 18:47:37 UTC
Created attachment 6574 [details]
proposed fix

Some older compilers do not like to initialize union members in the declaration
statement. The following patch fixes build failures on old freebsd systems using
older gnu c compilers
Comment 1 Stefan Metzmacher 2011-06-14 06:55:55 UTC
Comment on attachment 6574 [details]
proposed fix

Can you please paste the exact compiler version and
error output, thanks!

metze
Comment 2 Herb Lewis 2011-06-14 18:29:15 UTC
Here is the gcc version and the errors I saw

$ gcc --version
2.95.3

utils/net_registry.c: In function `net_registry_import':
utils/net_registry.c:961: unknown field `registry_value' specified in initializer
utils/net_registry.c:962: warning: missing braces around initializer
utils/net_registry.c:962: warning: (near initialization for `import_callback.setval')
utils/net_registry.c:962: warning: initialization from incompatible pointer type
utils/net_registry.c:963: unknown field `setval_type' specified in initializer
Comment 3 Stefan Metzmacher 2011-06-14 20:13:57 UTC
Ok, would the following work?


.setval = {
          .registry_value = (reg_import_callback_setval_registry_value_t)&import_create_val,
},
Comment 4 Herb Lewis 2011-06-14 21:07:00 UTC
Yes that will work.
Comment 5 Stefan Metzmacher 2011-06-15 10:30:05 UTC
5d736d87778754de7043d902c7d1d5db1c46cb02 is the fix in master.

Björn can you review it and assign to Karolin?
Comment 6 Karolin Seeger 2011-06-17 19:06:34 UTC
Pushed to v3-6-test.
Closing out bug report.

Thanks!