seL4 / util_libs

Other
53 stars 83 forks source link

libplatsupport: avoid clang warning #154

Closed axel-h closed 1 year ago

axel-h commented 1 year ago

Avoid warning on clang (v11.0.1): "'cold' attribute only applies to functions".

The warning make be think no optimization is happening at all with clang based on this attribute. Anything happening would either be a lucky coincidence oder some other heuristic kicks in.

This fix allows us to build with clang, as we handle all warnings as errors by default.

kent-mcleod commented 1 year ago

This fix allows us to build with clang, as we handle all warnings as errors by default.

Where is this creating a build failure?

axel-h commented 1 year ago

Where is this creating a build failure?

It is used here: https://github.com/seL4/camkes-tool/blob/master/libsel4camkes/include/camkes/error.h#L230

Seem that is the only place, HOT_PATH() seem the be used nowhere at all. So maybe removing this macro is the better option anyway?

kent-mcleod commented 1 year ago

Seem that is the only place, HOT_PATH() seem the be used nowhere at all. So maybe removing this macro is the better option anyway?

Yea I think that would be fine.