build.h inconsistency

Jelmer Vernooij jelmer at samba.org
Sat May 20 21:07:44 GMT 2006


Hi Tridge,

On Sat, May 20, 2006 at 01:20:48PM +1000, tridge at samba.org wrote:
> At the top of build.h we auto-generate prototypes for all the init
> functions. Unfortunately there is nothing that checks that these
> prototypes are correct. We just hit a problem with Samba4 dying on
> sparc64 linux because the ejs init functions returned void, but
> build.h declared them as returning NTSTATUS.
You can use the INIT_FUNCTION_TYPE setting in .mk files to set the
prototype for module init functions of a particular subsystem. The
default is:

INIT_FUNCTION_TYPE = NTSTATUS (*) (void)

LDB is currently the only subsystem that sets this option - it changes
the return type to int because it doesn't have NTSTATUS. 

> Any suggestions on how to fix this? A simple fix would be to include
> build.h in includes.h, as that will ensure we get prototype mismatches
> between the two prototypes, but I wonder if you can think of a better
> solution.
I would like to avoid including build.h in includes.h as it changes
every time config.status is rerun.

I'll try to think of a solution. There is a similar issue with 
generated .c files for shared modules at the moment.

Cheers,

Jelmer

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20060520/57871604/attachment.bin


More information about the samba-technical mailing list