Re: How to work around this compiler bug

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Marc Espie
Date: Sunday, May 2, 2010 - 1:00 pm

On Sun, May 02, 2010 at 12:54:42PM -0700, patrick keshishian wrote:

Doesn't change a lot.
It's still a very good idea to stay away from macros for most things in C++,
and if you require __LINE__, __FILE__, __func__, *then* you write a proper
inline function (or a template if it needs to be polymorphic), and only wrap
the most external call into a macro that inserts __LINE__... where needed.

That way, you get actual parameter type checking that you can understand,
and the macros themselves.

Everyone sane does things that way, and has used similar tricks even on
C compiler (check a proper getc definition on most any reasonable library,
the macro just inlines the buffer check, and defers the actual complicated
code to an out-of-line function).
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
How to work around this compiler bug, Christopher Zimmermann, (Sat May 1, 2:39 am)
Re: How to work around this compiler bug, Landry Breuil, (Sat May 1, 3:07 am)
Re: How to work around this compiler bug, Marc Espie, (Sat May 1, 5:11 am)
Re: How to work around this compiler bug, Michael Small, (Sat May 1, 5:46 am)
Re: How to work around this compiler bug, Marco Peereboom, (Sat May 1, 8:12 am)
Re: How to work around this compiler bug, Christopher Zimmermann, (Sun May 2, 3:59 am)
Re: How to work around this compiler bug, patrick keshishian, (Sun May 2, 12:54 pm)
Re: How to work around this compiler bug, Marc Espie, (Sun May 2, 1:00 pm)
Re: [SOLVED] How to work around this compiler bug, Christopher Zimmermann, (Sun May 2, 1:21 pm)
Re: How to work around this compiler bug, Christopher Zimmermann, (Thu May 20, 6:18 am)
Re: How to work around this compiler bug, Landry Breuil, (Thu May 20, 6:52 am)
Re: How to work around this compiler bug, Christopher Zimmermann, (Thu May 20, 7:01 am)
Re: [SOLVED] How to work around this compiler bug, Christopher Zimmermann, (Thu May 20, 7:45 am)
Re: [SOLVED] How to work around this compiler bug, David Coppa, (Thu May 20, 12:04 pm)