Hi im looking for a solution for GCC to printf a value which is calculated during compilation.
There is message pragmas but they can only print a user input string. what im looking for is a printf style output where i can input parameters.
example
printf("hi %s, my value is %d\n", "john", 15);
example 2: searching solution for this
void dummy(MyObjectReference & obj)
{
#if(sizeof(obj) != 512)
#pragma message "cannot build, your object size is not 512, it is %d", sizeof(obj)
#error "stop build"
#endif
obj.do_stuff();
return obj.get_result();
}