AutosarC++18_10-A27.0.3¶
Alternate input and output operations on a file stream shall not be used without an intervening flush or positioning call
Required inputs: IR, StaticSemanticAnalysis
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
alternating_input_output |
Alternating input and output without intervening flush or positioning. |
None |
False |
possibly_alternating_input_output |
Possibly alternating input and output without intervening flush or positioning. References a stream from outside the routine. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
consider_std_fstream¶
consider_std_fstream : bool = True
std::fstream should be considered.
consider_stlib_file_stream¶
consider_stlib_file_stream : bool = False
stdio.h FILE streams should
be considered.
reading_functions¶
reading_functions : set[bauhaus.analysis.config.QualifiedName] = {'fread', 'std::basic_istream::get', 'std::basic_istream::read', 'std::getline'}
operator>>
is always considered as a reading function.
report_non_local_streams¶
report_non_local_streams : bool = False
resetting_functions¶
resetting_functions
Possible functions that reset the stream or file for subsequent reading or writing. Any reassignment to a stream or file counts as resetting.Type: set[bauhaus.analysis.config.QualifiedName]
Default:
{'fflush', 'fseek', 'fsetpos', 'rewind', 'std::basic_istream::seekg', 'std::basic_istream::tellg', 'std::basic_ostream::flush', 'std::basic_ostream::seekp', 'std::basic_ostream::tellp', 'std::basic_streambuf::pubseekoff', 'std::basic_streambuf::pubseekpos', 'std::flush'}
writing_functions¶
writing_functions : set[bauhaus.analysis.config.QualifiedName] = {'fwrite', 'std::basic_ostream::put', 'std::basic_ostream::write'}
operator<< is always considered as a writing function.