News for hackers. Stuff that matters.
Re:C++ Attribute: Likely, Unlikely by Leherenn on Sunday October 22, 2023 @12:15PM (#37976667)
Do you have examples? It's not clear from the article how you could have a UB with them.
Re:C++ Attribute: Likely, Unlikely by pjmlp on Sunday October 22, 2023 @01:49PM (#37977516)
If I remember correctly, Timur Doumler does some remarks on that sense on his presentation:

"Standard Attributes in C and C++"

https://youtu.be/TDKqAWtvH9c?si=b5quQkMe7XUvBbG7

Re:C++ Attribute: Likely, Unlikely by fluoridation on Sunday October 22, 2023 @02:36PM (#37977894)
Could you least give some timestamps? It's nearly two hours.

Anyway, while it is possible that some attributes can cause UB if misused, I very much doubt that's possible with [[likely]] and [[unlikely]], as they are just hints for the optimizer, and the optimizer is supposed to preserve semantical guarantees.