Alexander Belopolsky <[email protected]> added the comment:
On Fri, Nov 26, 2010 at 8:41 PM, STINNER Victor <[email protected]> wrote: .. > I don't like macro having a result and using multiple instructions using the > evil > magic trick (the ","). It's harder to maintain the code and harder to debug > than > a classical function. > You are preaching to the choir. In fact, my first version (issue10521-unicode-next.diff attached to issue10521) used a function. I would not worry about implementation at this point, though. Let's find the best abstraction first. > Don't you think that modern compilers are able to inline the code? > (If not, we may add the right C attribute/keyword) Not in C. In C++, I could use a reference to the pointer incremented by the macro, but in C, I have to use an address. Once you take an address of a variable, the compiler will refuse to put it in a register. So no, I don't think we can write an ANSI C function that will be as efficient as the macro. ---------- _______________________________________ Python tracker <[email protected]> <http://bugs.python.org/issue10542> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
