|
Home > Archive > Unix Programming > July 2006 > Problem with porting BSD code to Linux (in sgtty.h)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem with porting BSD code to Linux (in sgtty.h)
|
|
| googler 2006-07-30, 1:24 am |
| I am trying to compile a program in Linux, that was originally written
for BSD, and getting compilation errors. Basically they are all related
to the file sgtty.h, where the compiler is not finding certain
definitions that are present in the BSD version of the file.
-----------------------------------------------------------
gcc `./sysprobe -flags` -DDEBUG -O3 -c syscall.c
gcc `./sysprobe -flags` -DDEBUG -O3 -c sgtty.c
sgtty.c:47: warning: `struct ltchars' declared inside parameter list
sgtty.c:47: warning: its scope is only this definition or declaration,
which is probably not what you want
sgtty.c:48: warning: `struct ltchars' declared inside parameter list
sgtty.c:49: warning: `struct tchars' declared inside parameter list
sgtty.c:50: warning: `struct tchars' declared inside parameter list
sgtty.c:52: conflicting types for `stty'
/usr/include/sgtty.h:36: previous declaration of `stty'
sgtty.c: In function `gtty':
sgtty.c:78: dereferencing pointer to incomplete type
sgtty.c:79: dereferencing pointer to incomplete type
sgtty.c:80: dereferencing pointer to incomplete type
sgtty.c:81: dereferencing pointer to incomplete type
sgtty.c:82: dereferencing pointer to incomplete type
sgtty.c:90: dereferencing pointer to incomplete type
sgtty.c: In function `tiocset':
sgtty.c:105: dereferencing pointer to incomplete type
sgtty.c:106: dereferencing pointer to incomplete type
sgtty.c:107: dereferencing pointer to incomplete type
sgtty.c:108: dereferencing pointer to incomplete type
sgtty.c:115: dereferencing pointer to incomplete type
sgtty.c: At top level:
sgtty.c:146: warning: `struct tchars' declared inside parameter list
sgtty.c:147: conflicting types for `tiocgetc'
sgtty.c:50: previous declaration of `tiocgetc'
sgtty.c: In function `tiocgetc':
sgtty.c:152: dereferencing pointer to incomplete type
sgtty.c:153: dereferencing pointer to incomplete type
sgtty.c:154: dereferencing pointer to incomplete type
sgtty.c:155: dereferencing pointer to incomplete type
sgtty.c:156: dereferencing pointer to incomplete type
sgtty.c:157: dereferencing pointer to incomplete type
sgtty.c: At top level:
sgtty.c:162: warning: `struct tchars' declared inside parameter list
sgtty.c:163: conflicting types for `tiocsetc'
sgtty.c:49: previous declaration of `tiocsetc'
sgtty.c: In function `tiocsetc':
sgtty.c:168: dereferencing pointer to incomplete type
sgtty.c:169: dereferencing pointer to incomplete type
sgtty.c:170: dereferencing pointer to incomplete type
sgtty.c:171: dereferencing pointer to incomplete type
sgtty.c:172: dereferencing pointer to incomplete type
sgtty.c:173: dereferencing pointer to incomplete type
sgtty.c: At top level:
sgtty.c:178: warning: `struct ltchars' declared inside parameter list
sgtty.c:179: conflicting types for `tiocgltc'
sgtty.c:48: previous declaration of `tiocgltc'
sgtty.c: In function `tiocgltc':
sgtty.c:184: dereferencing pointer to incomplete type
sgtty.c:185: dereferencing pointer to incomplete type
sgtty.c:186: dereferencing pointer to incomplete type
sgtty.c:187: dereferencing pointer to incomplete type
sgtty.c:188: dereferencing pointer to incomplete type
sgtty.c:189: dereferencing pointer to incomplete type
sgtty.c: At top level:
sgtty.c:194: warning: `struct ltchars' declared inside parameter list
sgtty.c:195: conflicting types for `tiocsltc'
sgtty.c:47: previous declaration of `tiocsltc'
sgtty.c: In function `tiocsltc':
sgtty.c:200: dereferencing pointer to incomplete type
sgtty.c:201: dereferencing pointer to incomplete type
sgtty.c:203: dereferencing pointer to incomplete type
sgtty.c:204: dereferencing pointer to incomplete type
sgtty.c:205: dereferencing pointer to incomplete type
sgtty.c:206: dereferencing pointer to incomplete type
sgtty.c: In function `bsd_ioctl':
sgtty.c:236: `TIOCGETP' undeclared (first use in this function)
sgtty.c:236: (Each undeclared identifier is reported only once
sgtty.c:236: for each function it appears in.)
sgtty.c:238: `TIOCSETP' undeclared (first use in this function)
sgtty.c:240: `TIOCGETC' undeclared (first use in this function)
sgtty.c:241: warning: passing arg 2 of `tiocgetc' from incompatible
pointer type
sgtty.c:242: `TIOCSETC' undeclared (first use in this function)
sgtty.c:243: warning: passing arg 2 of `tiocsetc' from incompatible
pointer type
sgtty.c:244: `TIOCGLTC' undeclared (first use in this function)
sgtty.c:245: warning: passing arg 2 of `tiocgltc' from incompatible
pointer type
sgtty.c:246: `TIOCSLTC' undeclared (first use in this function)
sgtty.c:247: warning: passing arg 2 of `tiocsltc' from incompatible
pointer type
sgtty.c:248: `TIOCLGET' undeclared (first use in this function)
sgtty.c:250: `TIOCLSET' undeclared (first use in this function)
sgtty.c:252: `TIOCFLUSH' undeclared (first use in this function)
sgtty.c:254: `TIOCSETN' undeclared (first use in this function)
make: *** [sgtty.o] Error 1
---------------------------------------------------------------------
Please tell me how I should work around this problem. Thanks for any
help.
| |
| Thomas Dickey 2006-07-30, 1:21 pm |
| googler <pinaki_m77@yahoo.com> wrote:
> I am trying to compile a program in Linux, that was originally written
> for BSD, and getting compilation errors. Basically they are all related
> to the file sgtty.h, where the compiler is not finding certain
> definitions that are present in the BSD version of the file.
sgtty.h is an antique (even on BSD's). Generally you would use termios or
termio to replace it. vttest is an application which has some ifdef's to
handle these three cases - you may find it useful to read that source to
see how to modify your application:
http://invisible-island.net/vttest/
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
|
|
|
|
|