Viktor Dukhovni: > On Sun, May 05, 2013 at 06:44:23PM +0000, Viktor Dukhovni wrote: > > > > May 5 20:35:31 mail postfix/master[2888]: warning: process > > > /usr/lib/postfix/smtp pid 2954 killed by signal 11 > > > > Thanks. Do you have a stack trace or core dump? > > Ralf sent be a stack trace captured via: > > http://www.postfix.org/DEBUG_README.html#screen > > problem fixed in the next snapshot. Nested macros need to be > careful with temporary variable names: > > Bug: > > #define foo(x) do { FOO *_t = x; bar(_t); /* code using _t */; } > #define bar(x) do { FOO *_t = x; /* code using _t */; }
Technical nit: this bug is not specific to nested macros. Name collisions with temp variables may happen for other reasons. Just like macro names must be distinct, their temp variable names must be distinct, too. The solution that I adopted looks as follows: #define foo(x) do { FOO _foo_ = (x); do stuff with _foo_; } while (0) That is, use all or part of the macro name for each temporary variable. Then, append suffixes to the names if needed. Wietse