« The code is THE documentation | Main | Digital Misfortunes: Off-the-shelf end-user product mafia »

November 30, 2008

Comments

thanasisk

assuming that you are within a C++ enviroment, #define should be banned.

If you just wanna save a function call, why not make it an inline function?

If you just wanna have a constant variable, why not use const and get more info while debugging?

No corner cases please :)

thanasisk

Kai edw o antilogos :-)

https://lixtetrax.wordpress.com/2008/12/26/refuting-tips-on-writing-c-macros/

Ante, ti 8a ginei, pote 8a grapsoyme ligo C parea? ;)

nobody

https://en.wikipedia.org/wiki/C_preprocessor#Token_concatenation

foo

how can you *ever* step into macros? you cannot, macros are processed by preprocessor and the compiler doesnt even know about them. So the generated code (which you effectively debug) doesnt have a hint of macros.

rodrigo

@foo, the preprocessor could add file/linenumber directives (like the ones it puts when processing #includes), which the compiler can then embed into the object code.

Not saying it would be easy (otherwise all compilers would do it), but it's not impossible in principle.

Dimitris Staikos

The SoftICE debugger could step into macros :-)
Pity it is a dead product...

The comments to this entry are closed.