You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testio.cpp
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -589,6 +589,23 @@ class TestIO : public TestFixture {
589
589
" fflush(stdout);\n"
590
590
"}", false, true);
591
591
ASSERT_EQUALS("", errout.str());
592
+
593
+
check("void foo(FILE*& f) {\n"
594
+
" f = fopen(path, \"r\");\n"
595
+
" fflush(f);\n"
596
+
"}", false, true);
597
+
ASSERT_EQUALS("[test.cpp:3]: (portability) fflush() called on input stream 'f' may result in undefined behaviour on non-linux systems.\n", errout.str());
0 commit comments