Thursday, June 15, 2017
Coworking day in Sophia Antipolis, at the "Business pole". Not expecting a very productive day, but it's more fun.
Mail flush
Flushing emails, most notably backlog on code reviews.
Mac Reboot
Running out of disk space regularly. Apparenlty, that's a result of having some Spicy running too long that ate enough memory to eat into my disk space. MacOS seems to be more resilient to this situation than Linux, at least showing some nice error messages that explains more or less what is going wrong. But it still does not recover from this condition too well.
Trace selection
Began sorting and classifying the SPICE_DEBUG instances, while thinking about the comments that were made about the approach.
Recorder
Added automated conversion for floating-point values using the _Generic keyword added in C11.
I noticed that the following code does not seem to be acceptable:
int foo(float); const char *strsignal(int);#define MACRO(arg) _Generic(arg, const char *: 0, char *: 1, float: foo(arg))
int test() { int x = MACRO(strsignal(3)); }
Apparently, even values that are not evaluated, such as foo(arg), must still compile even if it is not used for the type being considered. As a result, I had to rework the code to return a different, always valid function name, and pass arg every time:
#define RECORDER_ARG(_1,_2,_3,_4, arg,...) _Generic(arg, unsigned char: _recorder_unsigned, unsigned short: _recorder_unsigned, unsigned: _recorder_unsigned, unsigned long: _recorder_unsigned, unsigned long long:_recorder_unsigned, signed char: _recorder_signed, signed short: _recorder_signed, signed: _recorder_signed, signed long: _recorder_signed, signed long long: _recorder_signed, default: _recorder_pointer, float: _recorder_float, double: _recorder_double) (arg)
This is somewhat less efficient, as that requires going through an level of indirection even if what I'm doing is a simple cast or even a no-op.