sizeof a struct element

Hal Murray halmurray at sonic.net
Wed Sep 11 15:32:09 UTC 2024


I'm trying to cleanup the tangle in ntp_control.c that generates warnings. 
They may be actual bugs.  The problem is that the man page says long while 
the actual size may be 32 or 64 on 32 bit Linux systems.

If I knew the size, the fix would be simple.  wscript has code to get the 
size of a type but I don't know the type.

Can anybody write the waf code for me that will give me the size of 
ntx.errcnt if ntx is a struct timex?


The best alternative I've found so far is to work with the size of struct 
timex.  I think there are 3 cases:
  208: Linux with 64 bit slots
  128: Linux with 32 bit slots
  everybody else

I think I can make that work, but it's a bit ugly and somewhat of a time 
bomb if Linux messes with that struct.  But it has some spare slots, 
hinting that they don't want to make the sort of changes that would break 
that hackery.




-- 
These are my opinions.  I hate spam.





More information about the devel mailing list