This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

workaround to disable serial echoes causes linker warnings

I am trying to use the C8051 uart in a C program to talk to an AT modem device. To do this I need to work around the Keil library getchar which echoes received characters. So I made my own getchar function thinking this would override the library function. However, I am still using the stdio.h library because of all the other serial functions it has which build on this. When I try to build this project I get the following slew of linker warning messages.

*** WARNING L7: MODULE NAME NOT UNIQUE
MODULE: C:\KEIL\C51\LIB\C51S.LIB (GETCHAR)

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: ?C?CHARLOADED
MODULE: C:\KEIL\C51\LIB\C51S.LIB (UNGETC)

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: ?_UNGETCHAR?BYTE
MODULE: C:\KEIL\C51\LIB\C51S.LIB (UNGETC)

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: ?_UNGETCHAR?BYTE
MODULE: C:\KEIL\C51\LIB\C51S.LIB (UNGETC)
ADDRESS: 103CH

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: ?C?CHARLOADED
MODULE: C:\KEIL\C51\LIB\C51S.LIB (UNGETC)
ADDRESS: 103EH

My concern is wether the other library functions (ie scanf, printf, gets, puts, etc) will work with my customized overriding getchar. The first warning message makes me wonder about this. The remainder I take it are because I do not have ungetchar support written into my getchar function (do I need to in order to use scanf and the like?).

(note - I have looked at the following support page...
http://www.keil.com/support/docs/1791.htm
...and this is actually exactly what I am already doing which is giving me this concern)