Im trying to get something like 'custom-made' compiler warnings when the user uses variable types like int8_t which could result in unwanted behaviour (Are int8_t and uint8_t intended to be char types?).
Therefore I'd like to (optionally) replace these variable types and append a warning when they are used. My idea so far is something like this:
header.h
#pragma once
#pragma warning ("int8_t can be interpreted as char - replaced with int16_t")
#define int8_t int16_t
But this will not print the custom error msg, neither will it print it for each replacement but instead always print once, whether int8_t was replaced or not.
If you have any suggestions how to tackle this problem I would gladly appreciate any help!