CTSRD-CHERI / cheri-c-programming

CHERI C/C++ Programming Guide
28 stars 3 forks source link

Start documenting compiler warnings #2

Closed arichardson closed 4 years ago

arichardson commented 4 years ago

Also includes a bunch of other formatting changes.

arichardson commented 4 years ago

@brooksdavis @bsdjhb @jrtc27 Do you have any suggestions which other compiler warnings are common enough/surprising/difficult to fix/etc. to document here? I'm definitely going to add the ambiguous provenance one but I'm not sure which other ones are useful.

It should be possible to find almost all new warnings with a case-insensitive search for CHERI (or maybe capability) in https://github.com/CTSRD-CHERI/llvm-project/blob/dev/clang/include/clang/Basic/DiagnosticSemaKinds.td

bsdjhb commented 4 years ago

I'm probably just burned by hybrid code in the kernel, but if this generates a warning it needs to be documented:

uint64_t x = (uintptr_t)ptr;
jrtc27 commented 4 years ago

I'm probably just burned by hybrid code in the kernel, but if this generates a warning it needs to be documented:

uint64_t x = (uintptr_t)ptr;

Implicit casts from uintptr_t to uint64_t are fine, you get no warnings even with -Weverything.