This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Yet another SunOS4 fixincludes diff, termios.h, ioctl_fix_ctrl


	Here's another problem in fixincludes WRT sparc-sun-sunos4.1.4:


 > --- include.egcs-1.1.2/termios.h	Sat Jun  5 17:29:38 1999
 > +++ include.CVS19990609/termios.h	Wed Jun  9 12:48:25 1999
 > @@ -48,32 +48,32 @@
 >  #define	VTIME		VEOL
 >  
 >  #ifndef	_POSIX_SOURCE
 > -#define	_CTRL(c)	(c&037)
 > +#define	_CTRL(c)	('c'&037)
 >  
 >  /*
 >   * default control chars.
 >   * guarded for ttychars.h.
 >   */
 >  #ifndef	CINTR
 > -#define	CINTR	_CTRL('c')
 > +#define	CINTR	_CTRL(c)
 >  #define	CQUIT	034		/* FS, ^\ */
 >  #define	CERASE	0177		/* DEL, ^? */
 > -#define	CKILL	_CTRL('u')
 > -#define	CEOF	_CTRL('d')
 > +#define	CKILL	_CTRL(u)
 > +#define	CEOF	_CTRL(d)
 >  #define	CEOT	CEOF
 >  #define	CEOL	0
 >  #define	CEOL2	0
 >  #define	CSWTCH	0
 >  #define	CNSWTCH	0
 > -#define	CSTART	_CTRL('q')
 > -#define	CSTOP	_CTRL('s')
 > -#define	CSUSP	_CTRL('z')
 > -#define	CDSUSP	_CTRL('y')
 > -#define	CRPRNT	_CTRL('r')
 > -#define	CFLUSH	_CTRL('o')
 > -#define	CWERASE	_CTRL('w')
 > -#define	CLNEXT	_CTRL('v')
 > -#define CSTATUS _CTRL('t')
 > +#define	CSTART	_CTRL(q)
 > +#define	CSTOP	_CTRL(s)
 > +#define	CSUSP	_CTRL(z)
 > +#define	CDSUSP	_CTRL(y)
 > +#define	CRPRNT	_CTRL(r)
 > +#define	CFLUSH	_CTRL(o)
 > +#define	CWERASE	_CTRL(w)
 > +#define	CLNEXT	_CTRL(v)
 > +#define CSTATUS _CTRL(t)
 >  #endif	/* !CINTR */
 >  
 >  #define	CESC	'\\'


	This appears to happen because the ioctl_fix_ctrl fix never
runs on the termios.h file.  The select pattern for that fix in
inclhack.def is "CTRL[ \t]" (i.e. CTRL followed by at least one
whitespace char.)  All the CTRL instances are followed by an open
paren in termios.h.  Note the sed patterns don't require CTRL to have
a whitespace after it.

	I don't know what the proper regexp for the select statement
is.  The problem is that the ioctl_fix_ctrl fix is not documented at
all other than saying "Fix CTRL macros".  But its not like the old
fixincludes script had much in the way of docs anyway... :-)

	A related problem is that the ioctl_fix_ctrl gets run on many
other files unnecessarily because they contain macros whose name ends
in CTRL which matches the select pattern.  E.g. LEFTCTRL, RIGHTCTRL.
But these files aren't of the form of which the sed patterns operate
on.  Fixing the select value will fix this too.

	The third problem is that even if I force the ioctl_fix_ctrl fix
to run, I still get a one line diff of this:

 > @@ -48,7 +48,7 @@
 >  #define        VTIME           VEOL
 >  
 >  #ifndef        _POSIX_SOURCE
 > -#define        _CTRL(c)        (c&037)
 > +#define        _CTRL('c')      ('c'&037)
 >  
 >  /*
 >   * default control chars.


	So I'm not sure what the right patch for this is...

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]