This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PR 2767, V3 regression failure on strstr et al


>On 18-May-2001, Stephen M. Webb <stephen@bregmasoft.com> wrote:
>>   #include <bits/std_cstddef.h>
>>   
>>   #pragma GCC system_header
>> + 
>> + #define memchr  glibcpp_hidden_memchr
>> + #define strchr  glibcpp_hidden_strchr
>> + #define strpbrk glibcpp_hidden_strpbrk
>> + #define strrchr glibcpp_hidden_strrchr
>> + #define strstr  glibcpp_hidden_strstr
[...include system string.h...]

The original bug report had some form of this:

#include <cstring>
using namespace std;
void f() {
strstr("aba","b");
}

However, some program might legally do this (see D.5 of ISO C++):

#include <string.h>
#include <cstring>
using namespace std;
void f() {
strstr("aba","b");
}

Unfortunately, your approach breaks in this case.  However, you do get
us farther to a solution.  Thus, I am happy your patch was applied.

Regards,
Loren


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]