🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2556

gcc fixincludes script is broken by continued lines

#2556
From: Joe Wells
Date: Sun, 23 Apr 1989 21:18
69 lines
2675 bytes
The fixincludes script that comes with gcc 1.34 fails to transform
macro definitions like this:

#define	_IOR(x, y, t)	(IOC_OUT | ((sizeof (t) & IOCPARM_MASK) << 16) | \
			('x' << 8) | y)

This occurs because the macro definition is on two lines.  I have made
a change to fixincludes so that it will work no matter how many
continuation lines are used in a macro definition.  I'm including a
patch, for anyone who is interested.

Enjoy!

--
Joe Wells <jbw@bucsf.bu.edu>
jbw%bucsf.bu.edu@bu-it.bu.edu
...!harvard!bu-cs!bucsf!jbw
----------------------------------------------------------------------
*** fixincludes.orig	Sun Apr 23 16:52:24 1989
--- fixincludes	Sun Apr 23 16:34:49 1989
***************
*** 6,12 ****
  # for other versions, you had better check.
  
  # Directory in which to store the results.
! LIB=/usr15/degree/stud/jbw/gcc-include2
  
  echo 'Making directories:'
  cd /usr/include
--- 6,12 ----
  # for other versions, you had better check.
  
  # Directory in which to store the results.
! LIB=/usr15/degree/stud/jbw/gcc-include
  
  echo 'Making directories:'
  cd /usr/include
***************
*** 26,38 ****
        cp $file ${LIB}/$file >/dev/null 2>&1	\
        || echo "Can't copy $file"
        chmod +w ${LIB}/$file
!       ex ${LIB}/$file <<EOF
!       g/[ 	]_IO[A-Z]*(/s/(\(.\),/('\1',/
!       g/#define._IO/s/'x'/x/g
!       g/[^A-Z]CTRL[ 	]*(/s/\(.\))/'\1')/
!       g/#define.CTRL/s/'c'/c/g
!       wq
! EOF
        if cmp $file ${LIB}/$file >/dev/null 2>&1; then
           echo Deleting ${LIB}/$file\; no fixes were needed.
           rm ${LIB}/$file
--- 26,41 ----
        cp $file ${LIB}/$file >/dev/null 2>&1	\
        || echo "Can't copy $file"
        chmod +w ${LIB}/$file
!        sed -e '
! 				:loop
!        /\\$/			N
!        /\\$/			b loop
!        /[ 	]_IO[A-Z]*(/	s/(\(.\),/('\''\1'\'',/
!        /#define._IO/		s/'\''x'\''/x/g
!        /[^A-Z]CTRL[ 	]*(/	s/\(.\))/'\''\1'\'')/
!        /#define.CTRL/		s/'\''c'\''/c/g
!        ' ${LIB}/$file > ${LIB}/$file.sed
!        mv ${LIB}/$file.sed ${LIB}/$file
        if cmp $file ${LIB}/$file >/dev/null 2>&1; then
           echo Deleting ${LIB}/$file\; no fixes were needed.
           rm ${LIB}/$file
Technical Details
Message-ID: <8904232118.AA07488@banana6000.bu.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!BU-CS.BU.EDU!jbw%bucsf.BU.EDU

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!BU-CS.BU.EDU!jbw%bucsf.BU.EDU
From: jbw%bucsf.BU.EDU@BU-CS.BU.EDU (Joe Wells)
Newsgroups: gnu.gcc.bug
Subject: gcc fixincludes script is broken by continued lines
Message-ID: <8904232118.AA07488@banana6000.bu.edu>
Date: 23 Apr 89 21:18:21 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 69