MISRA Discussion Forums
Rule 8-4-4 Exception for stream manipulators? - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19)
+---- Forum: 6.8 Declarators (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=137)
+---- Thread: Rule 8-4-4 Exception for stream manipulators? (/showthread.php?tid=1782)



Rule 8-4-4 Exception for stream manipulators? - cgpzs - 07-09-2026

Hi,

Does Rule 8-4-4 imply that we have to write code like this? I do not see any exception for stream manipulators. Our static analyzer is flagging this case.

Code:
std::cout << "Hello World" << &std::endl;
                              ^



RE: Rule 8-4-4 Exception for stream manipulators? - cgpzs - 07-09-2026

It appears this has been addressed here:

https://forum.misra.org.uk/showthread.php?tid=1099&pid=2749#pid2749

Admins, consider editing the title of that thread to remove the erroneous characters, since it's very hard to see it relates to rule 8-4-4.


RE: Rule 8-4-4 Exception for stream manipulators? - misra cpp - 11-09-2026

As you say, https://forum.misra.org.uk/showthread.ph...49#pid2749 clarifies the intent of the rule with respect to MISRA C++:2008

It's worth noting that the equivalent rule in MISRA C++:2023, 7.11.3, allows the use of std::endl etc.