I compiled main.c and uart.c, and there were no errors.
sdcc -V  -mpic14 -p16f873a -c --use-non-free main.c
+ f:\PROGRA~1\SDCC\bin\sdcpp.exe -nostdinc -Wall -obj-ext=.o -DSDCC_USE_NON_FREE
 -DSDCC=300 -DSDCC_REVISION=6037 -DSDCC_pic14 -D__pic14 -DSDCC_PROCESSOR="16f873
a" -isystem "f:\Program Files\SDCC\bin\..\include\pic" -isystem "f:\Program File
s\SDCC\bin\..\include" -isystem "f:\Program Files\SDCC\bin\..\non-free\include\p
ic" -isystem "f:\Program Files\SDCC\bin\..\non-free\include"  "main.c"
main.c:26: warning 126: unreachable code
main.c:26: warning 85: in function main unreferenced local variable : 'chtemp'
+ C:\PROGRA~1\gputils\bin\gpasm.exe -o "main.o" -c "main.asm"
sdcc -V  -mpic14 -p16f873a -c --use-non-free hal\driver\uart\uart.c
+ f:\PROGRA~1\SDCC\bin\sdcpp.exe -nostdinc -Wall -obj-ext=.o -DSDCC_USE_NON_FREE
 -DSDCC=300 -DSDCC_REVISION=6037 -DSDCC_pic14 -D__pic14 -DSDCC_PROCESSOR="16f873
a" -isystem "f:\Program Files\SDCC\bin\..\include\pic" -isystem "f:\Program File
s\SDCC\bin\..\include" -isystem "f:\Program Files\SDCC\bin\..\non-free\include\p
ic" -isystem "f:\Program Files\SDCC\bin\..\non-free\include"  "hal\driver\uart\u
art.c"
+ C:\PROGRA~1\gputils\bin\gpasm.exe -o "uart.o" -c "uart.asm"
However, when I use  gplink to link them, the gplink reported errors.
 
gplink -m -s "C:\Program Files\gputils\lkr\16f873a.lkr" -o project.hex main.o uart.o "F:\Program Files\SDCC\lib\pic\libsdcc.lib"
warning: processor mismatch in "_gptrput1.o"
warning: processor mismatch in "shadowregs.o"
warning: processor mismatch in "idata.o"
warning: processor mismatch in "_gptrget1.o"
warning: processor mismatch in "_gptrget2.o"
error: missing definition for symbol "_RCSTA_bits", required by "uart.o"
error: missing definition for symbol "_RCREG", required by "uart.o"
error: missing definition for symbol "_STATUS", required by "_gptrput1.o"
error: missing definition for symbol "_TXSTA_bits", required by "uart.o"
error: missing definition for symbol "_TRISC_bits", required by "uart.o"
error: missing definition for symbol "_SPBRG", required by "uart.o"
error: missing definition for symbol "_TXREG", required by "uart.o"
error: missing definition for symbol "_PCLATH", required by "_gptrget1.o"
error: missing definition for symbol "_INDF", required by "_gptrput1.o"
error: missing definition for symbol "_PCL", required by "_gptrget1.o"
error: missing definition for symbol "_INTCON_bits", required by "uart.o"
error: missing definition for symbol "_FSR", required by "_gptrput1.o"
error: missing definition for symbol "_PIR1_bits", required by "uart.o"
error: missing definition for symbol "_PIE1_bits", required by "uart.o"
 
Was this sdcc bug£¿Or gplink error£¿