[ previous ] [ next ] [ threads ]
 To :  <Yate@v...>
 From :  "Andrew McDonald" <andrew.mcdonald@n...>
 Subject :  [yate] regex.c compilation error on VC++ Express
 Date :  Mon, 21 Aug 2006 14:17:35 +0800
Hi, 

The regerror function in regex.c fails to compile in  VC++ Express. This appears to be due to a compiler bug.

The function is declared using old-style parameter declarations and the first parameter is _named_ errcode. 
The VC++ issues a annoying and highly compiler specifc diagnostic warning about the _type_ errcode being deprecated and then appears to get horribly confused about parsing the rest of the parameter declarations....

.\regex.c(4878) : warning C4996: 'errcode' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdefs.h(506) : see declaration of 'errcode'
        Message: 'This name was supported during some Whidbey pre-releases. Instead, use the standard name errno_t.'
.\regex.c(4878) : error C2081: 'preg' : name in formal parameter list illegal
.\regex.c(4878) : error C2081: 'errbuf' : name in formal parameter list illegal
.\regex.c(4878) : error C2081: 'errbuf_size' : name in formal parameter list illegal
.\regex.c(4879) : warning C4028: formal parameter 2 different from declaration
.\regex.c(4879) : warning C4028: formal parameter 3 different from declaration
.\regex.c(4879) : warning C4028: formal parameter 4 different from declaration
.\regex.c(4879) : error C2055: expected formal parameter list, not a type list
.\regex.c(4879) : error C2082: redefinition of formal parameter 'errcode'
 
Renaming the errcode parameter or altering the declaration to "new" style works around the problem.

regards,

Andrew McDonald
System Architect

> Norwood Systems Australia Pty Ltd
71 Troy Terrace
PO Box 1281
Subiaco, WA 6904

> Tel	+61 8 9380 7766		
> Fax	+61 8 9380 7733  		
andrew.mcdonald@n...
>  
> The information in this email, and any attachments, may contain confidential information and is intended solely for the attention and use of the named addressee (s). It must not be disclosed to any person(s) without authorization. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorized to, and must not, disclose, copy, distribute, or retain this message or any part of it. If you have received this communication in error, please notify the sender immediately.
> 
> 
> 
>