Bug 1080 - make fails, "parse error before `SMB_BIG_UINT`" due to misordered includes.h
make fails, "parse error before `SMB_BIG_UINT`" due to misordered includes.h
Status: RESOLVED LATER
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.2
All other
: P3 normal
: none
Assigned To: Gerald (Jerry) Carter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-15 18:45 UTC by JimT
Modified: 2005-09-27 12:51 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JimT 2004-02-15 18:45:24 UTC
SUMMARY:
The source/includes/includes.h uses SMB_BIG_UINT before it is declared.

OBSERVATION:
This causes a compile of dynconfig.c to fail during the make on
LynxOS/ppc 4.0.0 patchlevel 48 with this error:

  In file included from /usr/include/sys/vfs.h:25,
                   from include/includes.h:293,
                   from dynconfig.c:21:
  include/vfs.h:200: parse error before `SMB_BIG_UINT'
  include/vfs.h:200: warning: no semicolon at end of struct or union
  include/vfs.h:200: warning: no semicolon at end of struct or union
  include/vfs.h:202: parse error before `unid_t'
  include/vfs.h:202: warning: `enum SMB_QUOTA_TYPE' declared inside parameter 
list
  include/vfs.h:202: warning: its scope is only this definition or 
declaration, which is probably not what you want.
  include/vfs.h:203: parse error before `unid_t'
  include/vfs.h:203: warning: `enum SMB_QUOTA_TYPE' declared inside parameter 
list
  
ANALYSIS:
The relevant portion of the include file ordering is:
  
  dynconfig.c:21                    #include "includes.h"
  include/includes.h:293                #include <sys/vfs.h>              
  /usr/include/sys/vfs.h:25                 #include <vfs.h>
  include/vfs.h:200                              SMB_BIG_UINT (*disk_free)(...
  include/includes.h:710                #define SMB_BIG_UINT unsigned long long

Within includes.h the sys/vfs.h include pulls in include/vfs.h which
makes a reference to SMB_BIG_UINT.  Later in the file at line 710 the
SMB_BIG_UINT is defined... too late.  

Further examination of includes.h reveals other SMB_BIG_UINT references
to SMB_BIG_UINT before it has been defined.

POSSIBLE FIX:
Move the SMB_BIG_UINT definitions up earlier in includes.h

CONCLUSIONS:
Thank you for all your great work on Samba.
Comment 1 Gerald (Jerry) Carter 2004-03-04 09:56:49 UTC
Thanks.  Got it.  Will be fixed in 3.0.3pre1
Comment 2 Gerald (Jerry) Carter 2005-07-14 11:30:52 UTC
I hate it when I mark something as fixed that isn't.

The #include <vfs.h> from sys/vfs.h should be
pulling the system's vfs.h and not ours.  Silly
header name conflict.

Comment 3 Gerald (Jerry) Carter 2005-07-14 12:16:28 UTC
Jeremy, the only solution I see if to rename our vfs.h.
Have you got a better idea?
Comment 4 Gerald (Jerry) Carter 2005-09-27 12:51:09 UTC
later.  trying to clean house to find the real bugs.