[tz] suggestions for potential code improvements?

Paul Eggert eggert at cs.ucla.edu
Fri Jul 24 16:18:13 UTC 2015


Kees Dekker wrote:
> Will this patch become part of a successor version of the code?

I'm leaning against the idea, since it hurts performance very slightly and does 
not fix any bugs (it's just a style thing).

> some compiler may complain about assigning a 3-character string literal (which is actually 4 bytes) to an array of 3-byte strings

The C standard explicitly says this is OK.  Obviously a compiler can warn about 
it anyway, but normally we just use the latest stable GCC and pacify it with the 
settings in $(GCC_DEBUG_FLAGS).  We don't have the time or inclination to pacify 
every pedantic compiler.  On a case-by-case basis we can fix some issues (as I 
just did with 'const') but in the case of this 3-char literal pacifying the 
compiler would bloat the executable, and it's not worth it.

> I will try to find a platform that complies about non-initialized variables.

Please don't forget to compile with -Dlint when you do that.


More information about the tz mailing list