From davidm@AZStarNet.com Mon Sep 2 10:39:42 1996 Date: Sun, 1 Sep 1996 21:06:10 -0700 From: David Mosberger-Tang To: ewt@redhat.com Cc: richard@atheist.tamu.edu Subject: awk fix The patch below fixes the unaligned accesses. This is a genuine bug, so it's better to fix it asap (not that unaligned accesses are not worth fixing...). The problem is as follows: re_syntax_options is a bss symbol in libc that is 4 bytes long. GNU awk comes with its own regex.{h,c} files and there, that variable is declared as an `unsigned long' common symbol. The runtimes linker then resolves that symbol to the instance in the shared library. So gawk accesses that variable as a "long" while in reality it's just 4 bytes long. Actually, the linker warns about this. Probably good to keep an eye open for these: ld: Warning: size of symbol `re_syntax_options' changed from 8 to 4 in /lib/libc.so.6 --david --- gawk-3.0.0/regex.c.~1~ Fri Dec 15 04:53:05 1995 +++ gawk-3.0.0/regex.c Sun Sep 1 19:10:54 1996 @@ -920,7 +920,7 @@ syntax, so it can be changed between regex compilations. */ /* This has no initializer because initialized variables in Emacs become read-only after dumping. */ -reg_syntax_t re_syntax_options; +reg_syntax_t re_syntax_options = 0; /* Specify the precise syntax of regexps for compilation. This provides