What if the checked attributes of the 2 projects are the same? This is quite probable whenyou load a different version of the same project (e.g. a backup). Ideally, thesolution does not depend on any attribute at all. Would it make sense to setm_LastProject to nullptr on close or would that contradict its purpose?

You can leave the pointer comparison probably, just make sure that the pointer is reset when there is no project loaded. Everything else should probably stay the same.

I have spent hours trapping events, hoping to find one that could be used to reliably reset the old project pointer in macros manager.

Unfortunately, there is no CB event that can be used to reliably reset the last project pointer to zero when multiple projects exist within a workspace and the user does a full workspace build.

The pointer must be reset between compiles of projects within a workspace as well as project activation, open and close.

The compiler events can be used to reset the pointer just before a compile, but these events are (erroneously) invoked by the CodeCompletion plugin so many times it's a turkey shoot to figure out if it's a CodeCompletion call or a real request for compilation. The current comparisons are less overhead then resetting the project pointer for erroneous compilation events.

Using complilation events would also miss the needed project events reset.

The current patch is the only method I can find to reliably reset the old project pointer for both api macro translation calls (cb core, plugins, scripts, etc) and which catch all events that require macro translation.

I just noticed that -std=c11 is not available as a standard compiler flag. It's trivial to enable it in "Other compiler options", or add it as a new flag, but still, it should be a flag provided by default...

I just noticed that -std=c11 is not available as a standard compiler flag. It's trivial to enable it in "Other compiler options", or add it as a new flag, but still, it should be a flag provided by default...