zsh-workers
 help / color / mirror / code / Atom feed
* gawk problem during build, and patches
@ 1999-08-06 23:31 Ed Osinski
  1999-08-07  7:00 ` Geoff Wing
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Osinski @ 1999-08-06 23:31 UTC (permalink / raw)
  To: zsh-workers

While building zsh 3.0.6, I got the following:

gawk -f ./rlimits.awk /usr/include/sys/resource.h > rlimits.h
gcc -c -I.. -I. -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -Wall -Wno-implicit -Wmissing-prototypes -O2 builtin.c
In file included from builtin.c:3679:
rlimits.h:7: parse error at null character

When I looked at rlimits.h, I see:

-----------------------------------------------------------
/** rlimits.h                                 **/
/** architecture-customized limits for zsh **/

#define ZSH_NLIMITS 7

static char *recs[ZSH_NLIMITS+1] = {
	\0cputime\0,
	\0filesize\0,
	\0datasize\0,
	\0stacksize\0,
	\0coredumpsize\0,
	\0descriptors\0,
	\0vmemorysize\0,
	NULL
};
-----------------------------------------------------------

signames.h had similar problems.  The culprits were lines like

             printf("\t%c%s%c,\n", 034, lim[i], 034)

in the .awk files.  Somehow, the 034 was not being interpreted as a
quote (").  I have gawk 3.0.4 installed, but I see that I configured
it with the --enable-non-decimal-data switch.  I assume this means
that 034 is taken to be an octal number, which is not intended.  I
changed the .awk files to just use \" in the format string instead of
%c and a parameter.  I've included patches below.  (I'm not a
subscriber to the list, so if there are any problems, please send me
email.)

- Ed


-----------------------------------------------------------
*** Src/rlimits.awk~    Wed Apr 28 01:21:43 1999
--- Src/rlimits.awk     Fri Aug  6 18:51:54 1999
***************
*** 63,69 ****
        if (msg[i] == "") {
              badlimit++
!             printf("\t%c%s%c,\n", 034, lim[i], 034)
        } else
!           printf("\t%c%s%c,\n", 034, msg[i], 034)
      print "\tNULL"
      print "};"
--- 63,69 ----
        if (msg[i] == "") {
              badlimit++
!             printf("\t\"%s\",\n", lim[i])
        } else
!           printf("\t\"%s\",\n", msg[i])
      print "\tNULL"
      print "};"
-----------------------------------------------------------
*** Src/signames.awk~	Wed Apr 28 01:21:45 1999
--- Src/signames.awk	Fri Aug  6 18:54:32 1999
***************
*** 52,63 ****
  END {
      ps = "%s"
!     ifdstr = sprintf("#ifdef USE_SUSPENDED\n\t%csuspended%s%c,\n%selse\n\t%cstopped%s%c,\n#endif\n", 034, ps, 034, "#", 034, ps, 034)
  
!     printf("%s\n%s\n\n%s\t%d\n\n%s\n\n%s\n\t%c%s%c,\n", "/** signals.h                                 **/", "/** architecture-customized signals.h for zsh **/", "#define SIGCOUNT", max, "#ifdef GLOBALS", "char *sigmsg[SIGCOUNT+2] = {", 034, "done", 034)
  
      for (i = 1; i <= 0 + max; i++)
  	if (msg[i] == "") {
  	    if (sig[i] == "")
! 		printf("\t%c%c,\n", 034, 034)
  	    else if (sig[i] == "STOP")
  		printf ifdstr, " (signal)", " (signal)"
--- 52,63 ----
  END {
      ps = "%s"
!     ifdstr = sprintf("#ifdef USE_SUSPENDED\n\t\"suspended%s\",\n%selse\n\t\"stopped%s\",\n#endif\n", ps, "#", ps)
  
!     printf("%s\n%s\n\n%s\t%d\n\n%s\n\n%s\n\t\"%s\",\n", "/** signals.h                                 **/", "/** architecture-customized signals.h for zsh **/", "#define SIGCOUNT", max, "#ifdef GLOBALS", "char *sigmsg[SIGCOUNT+2] = {", "done")
  
      for (i = 1; i <= 0 + max; i++)
  	if (msg[i] == "") {
  	    if (sig[i] == "")
! 		printf "\t\"\",\n"
  	    else if (sig[i] == "STOP")
  		printf ifdstr, " (signal)", " (signal)"
***************
*** 69,87 ****
  		printf ifdstr, " (tty output)", " (tty output)"
  	    else
! 		printf("\t%cSIG%s%c,\n", 034, sig[i], 034)
  	} else
! 	    printf("\t%c%s%c,\n", 034, msg[i], 034)
      print "\tNULL"
      print "};"
      print ""
      printf "char *sigs[SIGCOUNT+4] = {\n"
!     printf("\t%cEXIT%c,\n", 034, 034)
      for (i = 1; i <= 0 + max; i++)
  	if (sig[i] == "")
! 	    printf("\t%c%d%c,\n", 034, i, 034)
  	else
! 	    printf("\t%c%s%c,\n", 034, sig[i], 034)
!     printf("\t%cZERR%c,\n", 034, 034)
!     printf("\t%cDEBUG%c,\n", 034, 034)
      print "\tNULL"
      print "};"
--- 69,87 ----
  		printf ifdstr, " (tty output)", " (tty output)"
  	    else
! 		printf("\t\"SIG%s\",\n", sig[i])
  	} else
! 	    printf("\t\"%s\",\n", msg[i])
      print "\tNULL"
      print "};"
      print ""
      printf "char *sigs[SIGCOUNT+4] = {\n"
!     printf "\t\"EXIT\",\n"
      for (i = 1; i <= 0 + max; i++)
  	if (sig[i] == "")
! 	    printf("\t\"%d\",\n", i)
  	else
! 	    printf("\t\"%s\",\n", sig[i])
!     printf "\t\"ZERR\",\n"
!     printf "\t\"DEBUG\",\n"
      print "\tNULL"
      print "};"
-----------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gawk problem during build, and patches
  1999-08-06 23:31 gawk problem during build, and patches Ed Osinski
@ 1999-08-07  7:00 ` Geoff Wing
  0 siblings, 0 replies; 2+ messages in thread
From: Geoff Wing @ 1999-08-07  7:00 UTC (permalink / raw)
  To: Zsh Hackers; +Cc: Ed Osinski

Ed Osinski <osinski@cs.nyu.edu> typed:
:While building zsh 3.0.6, I got the following:
:gawk -f ./rlimits.awk /usr/include/sys/resource.h > rlimits.h
:gcc -c -I.. -I. -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -DHAVE_CON=
:FIG_H -Wall -Wno-implicit -Wmissing-prototypes -O2 builtin.c
:In file included from builtin.c:3679:
:rlimits.h:7: parse error at null character
:-----------------------------------------------------------
:signames.h had similar problems.  The culprits were lines like
:             printf("\t%c%s%c,\n", 034, lim[i], 034)

Note: 3.1.6 uses ``34'' not ``034''.  The reasoning behind 034 escapes
me at the moment; I don't think it was random but I can't find
anything about it in my zsh email from 1996 and I don't think we were
using RCS back then so who knows?
Also note my comment at the top of the file: \" can't be used generally
because some systems barf on it.

sed 's/034/34/g' might have been quicker :-)

:in the .awk files.  Somehow, the 034 was not being interpreted as a
:quote (").  I have gawk 3.0.4 installed, but I see that I configured
:it with the --enable-non-decimal-data switch.  I assume this means
:that 034 is taken to be an octal number, which is not intended.  I
:changed the .awk files to just use \" in the format string instead of
:%c and a parameter.  I've included patches below.  (I'm not a
:subscriber to the list, so if there are any problems, please send me
:email.)

Regards,
-- 
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-08-07  7:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-06 23:31 gawk problem during build, and patches Ed Osinski
1999-08-07  7:00 ` Geoff Wing

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).