
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Steve Cornett
The file boost/preprocessor/stringize.hpp contains a trivial bug, for which I have attached a proposed patch. The problem is that there are three incorrect usages of the ## operator. The proposed fix is to simply remove the ## operators, as they are unnecessary.
The ## operator joins two tokens and makes a new single token. But all three usages of ## in this file attempt to join an identifier with '(', which does not result in a single token. The action taken by most C/C++ translators in this situation is to rescan the invalid text back into two tokens, which makes the incorrect ## usage innocuous in most situations. However, the behavior is undefined by the C++ and C standards. With our code coverage tool, this improper ## usage results in a warning.
Similar things are done all over the library, not just in 'stringize.hpp'. I'm well aware that behavior of such use is undefined. However, they are necessary workarounds for preprocessors that are broken in other ways. You will never see it occur in the entire library if the library is preprocessed in its strict configuration, for example. Suffice to say, they cannot be removed. Regards, Paul Mensonides