Стандарт языка Си С99 TC (1113411), страница 84
Текст из файла (страница 84)
operator for the type parameter, or designates a bit-field (7.17).— The argument in an instance of one of the integer-constant macros is not a decimal,octal, or hexadecimal constant, or it has a value that exceeds the limits for thecorresponding type (7.18.4).— A byte input/output function is applied to a wide-oriented stream, or a wide characterinput/output function is applied to a byte-oriented stream (7.19.2).— Use is made of any portion of a file beyond the most recent wide character written toa wide-oriented stream (7.19.2).— The value of a pointer to a FILE object is used after the associated file is closed(7.19.3).— The stream for the fflush function points to an input stream or to an update streamin which the most recent operation was input (7.19.5.2).— The string pointed to by the mode argument in a call to the fopen function does notexactly match one of the specified character sequences (7.19.5.3).— An output operation on an update stream is followed by an input operation without anintervening call to the fflush function or a file positioning function, or an inputoperation on an update stream is followed by an output operation with an interveningcall to a file positioning function (7.19.5.3).— An attempt is made to use the contents of the array that was supplied in a call to thesetvbuf function (7.19.5.6).— There are insufficient arguments for the format in a call to one of the formattedinput/output functions, or an argument does not have an appropriate type (7.19.6.1,7.19.6.2, 7.24.2.1, 7.24.2.2).— The format in a call to one of the formatted input/output functions or to thestrftime or wcsftime function is not a valid multibyte character sequence thatbegins and ends in its initial shift state (7.19.6.1, 7.19.6.2, 7.23.3.5, 7.24.2.1, 7.24.2.2,7.24.5.1).— In a call to one of the formatted output functions, a precision appears with aconversion specifier other than those described (7.19.6.1, 7.24.2.1).— A conversion specification for a formatted output function uses an asterisk to denotean argument-supplied field width or precision, but the corresponding argument is notprovided (7.19.6.1, 7.24.2.1).— A conversion specification for a formatted output function uses a # or 0 flag with aconversion specifier other than those described (7.19.6.1, 7.24.2.1).§J.2Portability issues501ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256— A conversion specification for one of the formatted input/output functions uses alength modifier with a conversion specifier other than those described (7.19.6.1,7.19.6.2, 7.24.2.1, 7.24.2.2).— An s conversion specifier is encountered by one of the formatted output functions,and the argument is missing the null terminator (unless a precision is specified thatdoes not require null termination) (7.19.6.1, 7.24.2.1).— An n conversion specification for one of the formatted input/output functions includesany flags, an assignment-suppressing character, a field width, or a precision (7.19.6.1,7.19.6.2, 7.24.2.1, 7.24.2.2).— A % conversion specifier is encountered by one of the formatted input/outputfunctions, but the complete conversion specification is not exactly %% (7.19.6.1,7.19.6.2, 7.24.2.1, 7.24.2.2).— An invalid conversion specification is found in the format for one of the formattedinput/output functions, or the strftime or wcsftime function (7.19.6.1, 7.19.6.2,7.23.3.5, 7.24.2.1, 7.24.2.2, 7.24.5.1).— The number of characters transmitted by a formatted output function is greater thanINT_MAX (7.19.6.1, 7.19.6.3, 7.19.6.8, 7.19.6.10).— The result of a conversion by one of the formatted input functions cannot berepresented in the corresponding object, or the receiving object does not have anappropriate type (7.19.6.2, 7.24.2.2).— A c, s, or [ conversion specifier is encountered by one of the formatted inputfunctions, and the array pointed to by the corresponding argument is not large enoughto accept the input sequence (and a null terminator if the conversion specifier is s or[) (7.19.6.2, 7.24.2.2).— A c, s, or [ conversion specifier with an l qualifier is encountered by one of theformatted input functions, but the input is not a valid multibyte character sequencethat begins in the initial shift state (7.19.6.2, 7.24.2.2).— The input item for a %p conversion by one of the formatted input functions is not avalue converted earlier during the same program execution (7.19.6.2, 7.24.2.2).— The vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf,vsscanf, vfwprintf, vfwscanf, vswprintf, vswscanf, vwprintf, orvwscanf function is called with an improperly initialized va_list argument, orthe argument is used (other than in an invocation of va_end) after the functionreturns (7.19.6.8, 7.19.6.9, 7.19.6.10, 7.19.6.11, 7.19.6.12, 7.19.6.13, 7.19.6.14,7.24.2.5, 7.24.2.6, 7.24.2.7, 7.24.2.8, 7.24.2.9, 7.24.2.10).— The contents of the array supplied in a call to the fgets, gets, or fgetws functionare used after a read error occurred (7.19.7.2, 7.19.7.7, 7.24.3.2).502Portability issues§J.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3— The file position indicator for a binary stream is used after a call to the ungetcfunction where its value was zero before the call (7.19.7.11).— The file position indicator for a stream is used after an error occurred during a call tothe fread or fwrite function (7.19.8.1, 7.19.8.2).— A partial element read by a call to the fread function is used (7.19.8.1).— The fseek function is called for a text stream with a nonzero offset and either theoffset was not returned by a previous successful call to the ftell function on astream associated with the same file or whence is not SEEK_SET (7.19.9.2).— The fsetpos function is called to set a position that was not returned by a previoussuccessful call to the fgetpos function on a stream associated with the same file(7.19.9.3).— A non-null pointer returned by a call to the calloc, malloc, or realloc functionwith a zero requested size is used to access an object (7.20.3).— The value of a pointer that refers to space deallocated by a call to the free orrealloc function is used (7.20.3).— The pointer argument to the free or realloc function does not match a pointerearlier returned by calloc, malloc, or realloc, or the space has beendeallocated by a call to free or realloc (7.20.3.2, 7.20.3.4).— The value of the object allocated by the malloc function is used (7.20.3.3).— The value of any bytes in a new object allocated by the realloc function beyondthe size of the old object are used (7.20.3.4).— The program executes more than one call to the exit function (7.20.4.3).— During the call to a function registered with the atexit function, a call is made tothe longjmp function that would terminate the call to the registered function(7.20.4.3).— The string set up by the getenv or strerror function is modified by the program(7.20.4.5, 7.21.6.2).— A command is executed through the system function in a way that is documented ascausing termination or some other form of undefined behavior (7.20.4.6).— A searching or sorting utility function is called with an invalid pointer argument, evenif the number of elements is zero (7.20.5).— The comparison function called by a searching or sorting utility function alters thecontents of the array being searched or sorted, or returns ordering valuesinconsistently (7.20.5).§J.2Portability issues503ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256— The array being searched by the bsearch function does not have its elements inproper order (7.20.5.1).— The current conversion state is used by a multibyte/wide character conversionfunction after changing the LC_CTYPE category (7.20.7).— A string or wide string utility function is instructed to access an array beyond the endof an object (7.21.1, 7.24.4).— A string or wide string utility function is called with an invalid pointer argument, evenif the length is zero (7.21.1, 7.24.4).— The contents of the destination array are used after a call to the strxfrm,strftime, wcsxfrm, or wcsftime function in which the specified length wastoo small to hold the entire null-terminated result (7.21.4.5, 7.23.3.5, 7.24.4.4.4,7.24.5.1).— The first argument in the very first call to the strtok or wcstok is a null pointer(7.21.5.8, 7.24.4.5.7).— The type of an argument to a type-generic macro is not compatible with the type ofthe corresponding parameter of the selected function (7.22).— A complex argument is supplied for a generic parameter of a type-generic macro thathas no corresponding complex function (7.22).— The argument corresponding to an s specifier without an l qualifier in a call to thefwprintf function does not point to a valid multibyte character sequence thatbegins in the initial shift state (7.24.2.11).— In a call to the wcstok function, the object pointed to by ptr does not have thevalue stored by the previous call for the same wide string (7.24.4.5.7).— An mbstate_t object is used inappropriately (7.24.6).— The value of an argument of type wint_t to a wide character classification or casemapping function is neither equal to the value of WEOF nor representable as awchar_t (7.25.1).— The iswctype function is called using a different LC_CTYPE category from theone in effect for the call to the wctype function that returned the description(7.25.2.2.1).— The towctrans function is called using a different LC_CTYPE category from theone in effect for the call to the wctrans function that returned the description(7.25.3.2.1).504Portability issues§J.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3J.3 Implementation-defined behavior1A conforming implementation is required to document its choice of behavior in each ofthe areas listed in this subclause.