Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Pragmas are processed by the pre-processor, so they aren't appropriate for expressing control flow hints.

I don't thing this is remotely true. C++ pragmas were designed with the express purpose of providing additional information to compilers.



Attributes are better suited for that. #pragma has always just been a grandfathered in hack.


> Attributes are better suited for that. #pragma has always just been a grandfathered in hack.

I'm not so sure attributes are better. They have political traction, but that does not mean better. All major compilers use pragmas effectively to implement custom compiler flags. See for instance how Visual C++ uses pragmas extensively to toggle specific compiler warnings, not to mention the infamous #pragma once




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: