std.cfg: Improved configuration of setvbuf().
This commit is contained in:
parent
561e21e2aa
commit
53ebb55e1f
|
@ -49,6 +49,9 @@
|
|||
<define name="M_2_SQRTPI" value="1.12837916709551257390"/>
|
||||
<define name="M_SQRT2" value="1.41421356237309504880"/>
|
||||
<define name="M_SQRT1_2" value="0.70710678118654752440"/>
|
||||
<define name="_IOFBF" value="0"/>
|
||||
<define name="_IOLBF" value="1"/>
|
||||
<define name="_IONBF" value="2"/>
|
||||
<!-- errno_t is a typedef for int -->
|
||||
<define name="errno_t" value="int"/>
|
||||
<!-- void abort(void); -->
|
||||
|
@ -4665,9 +4668,12 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
</arg>
|
||||
<arg nr="2">
|
||||
<not-uninit/>
|
||||
<minsize type="argvalue" arg="4"/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
<!-- Note: _IOFBF=0, _IOLBF=1 and _IONBF=2 has been set to in this configuration-->
|
||||
<valid>0:2</valid>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
|
|
|
@ -3120,6 +3120,22 @@ void nullPointer_setbuf(FILE *stream, char *buf)
|
|||
setbuf(stream,buf);
|
||||
}
|
||||
|
||||
int bufferAccessOutOfBounds_setvbuf(FILE* stream, int mode, size_t size)
|
||||
{
|
||||
char buf[42]={0};
|
||||
// cppcheck-suppress bufferAccessOutOfBounds
|
||||
(void) setvbuf(stream, buf, mode, 43);
|
||||
return setvbuf(stream, buf, mode, 42);
|
||||
}
|
||||
|
||||
int nullPointer_setvbuf(FILE* stream, char *buf, int mode, size_t size)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) setvbuf(NULL, buf, mode, size);
|
||||
(void) setvbuf(stream, NULL, mode, size);
|
||||
return setvbuf(stream, buf, mode, size);
|
||||
}
|
||||
|
||||
void uninitvar_setbuf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
|
|
|
@ -2615,6 +2615,30 @@ void uninivar_setbuf(void)
|
|||
(void)std::setbuf(stream,buf);
|
||||
}
|
||||
|
||||
void nullPointer_setbuf(FILE *stream, char *buf)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
std::setbuf(NULL,buf);
|
||||
std::setbuf(stream,NULL);
|
||||
std::setbuf(stream,buf);
|
||||
}
|
||||
|
||||
int bufferAccessOutOfBounds_setvbuf(FILE* stream, int mode, size_t size)
|
||||
{
|
||||
char buf[42]={0};
|
||||
// cppcheck-suppress bufferAccessOutOfBounds
|
||||
(void) std::setvbuf(stream, buf, mode, 43);
|
||||
return std::setvbuf(stream, buf, mode, 42);
|
||||
}
|
||||
|
||||
int nullPointer_setvbuf(FILE* stream, char *buf, int mode, size_t size)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) std::setvbuf(NULL, buf, mode, size);
|
||||
(void) std::setvbuf(stream, NULL, mode, size);
|
||||
return std::setvbuf(stream, buf, mode, size);
|
||||
}
|
||||
|
||||
void uninivar_setvbuf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
|
|
Loading…
Reference in New Issue