Скачиваний:
46
Добавлен:
21.03.2016
Размер:
985.51 Кб
Скачать

Keil Software — C51 Compiler User’s Guide

309

 

 

Appendix A. Differences from ANSI C

The C51 compiler differs in only a few aspects from the ANSI C Standard. These differences can be grouped into compiler-related differences and library-related differences.

Compiler-related Differences

A

!Wide Characters

Wide 16-bit characters are not supported by C51. ANSI provides wide characters for future support of an international character set.

!Recursive Function Calls

Recursive function calls are not supported by default. Functions that are recursive must be declared using the reentrant function attribute. Reentrant functions can be called recursively because the local data and parameters are stored in a reentrant stack. In comparison, functions which are not declared using the reentrant attribute use static memory segments for the local data of the function. A recursive call to these functions overwrites the local data of the prior function call instance.

Library-related Differences

The ANSI C Standard Library includes a vast number of routines, most of which are included in C51. Many, however, are not applicable to an embedded application and are excluded from the C51 library.

The following ANSI Standard library routines are included in the C51 library:

abs

cosh

isgraph

acos

exp

islower

asin

fabs

isprint

atan

floor

ispunct

atan2

free

isspace

atof

getchar

isupper

atoi

gets

isxdigit

atol

isalnum

labs

calloc

isalpha

log

ceil

iscntrl

log10

cos

isdigit

longjmp

 

 

310

 

Appendix A. Differences from ANSI C

 

 

 

 

 

 

 

malloc

setjmp

strncmp

 

 

memchr

sin

strncpy

 

 

A

 

memcmp

sinh

strpbrk

 

memcpy

sprintf

strrchr

 

 

 

 

memmove

sqrt

strspn

 

 

memset

srand

tan

 

 

 

 

modf

sscanf

tanh

 

 

pow

strcat

tolower

 

 

printf

strchr

toupper

 

 

putchar

strcmp

va_arg

 

 

puts

strcpy

va_end

 

 

rand

strcspn

va_start

 

 

realloc

strlen

vprintf

 

 

scanf

strncat

vsprintf

 

 

The following ANSI Standard library routines are not included in the C51

 

 

library:

 

 

 

 

abort

freopen

rename

 

 

asctime

frexp

rewind

 

 

atexit

fscanf

setbuf

 

 

bsearch

fseek

setlocale

 

 

clearerr

fsetpos

setvbuf

 

 

clock

ftell

signal

 

 

ctime

fwrite

strcoll

 

 

difftime

getc

strerror

 

 

div

getenv

strftime

 

 

exit

gmtime

strstr

 

 

fclose

ldexp

strtod

 

 

feof

ldiv

strtok

 

 

ferror

localeconv

strtol

 

 

fflush

localtime

strtoul

 

 

fgetc

mblen

strxfrm

 

 

fgetpos

mbstowcs

system

 

 

fgets

mbtowc

time

 

 

fmod

mktime

tmpfile

 

 

fopen

perror

tmpnam

 

 

fprintf

putc

ungetc

 

 

fputc

qsort

vfprintf

 

 

fputs

raise

wcstombs

 

 

fread

remove

wctomb

Keil Software — C51 Compiler User’s Guide

311

 

 

The following routines are not found in the ANSI Standard Library but are included in the C51 library.

acos517

_irol_

sqrt517

asin517

_iror_

sscanf517

atan517

log10517

strpos

atof517

log517

strrpbrk

cabs

_lrol_

strrpos

_chkfloat_

_lror_

tan517

cos517

memccpy

_testbit_

_crol_

_nop_

toascii

_cror_

printf517

toint

exp517

scanf517

_tolower

_getkey

sin517

_toupper

init_mempool

sprintf517

ungetchar

A

312

Appendix A. Differences from ANSI C

 

 

A

Соседние файлы в папке Лаборатория