[pcre-dev] [Bug 939] New: Declaration difference in _pcre_*…

Top Page
Delete this message
Author: vszakats
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 939] New: Declaration difference in _pcre_*_newline() confuses some C++ compiler
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=939
           Summary: Declaration difference in _pcre_*_newline() confuses
                    some C++ compiler
           Product: PCRE
           Version: 7.8
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: vszakats@???
                CC: pcre-dev@???



Hi Philip,

In PCRE library version 8.00 we have in pcre_internal.h:
  extern BOOL _pcre_is_newline(const uschar *, int, const uschar *,
                               int *, BOOL);
  extern BOOL _pcre_was_newline(const uschar *, int, const uschar *,
                                int *, BOOL);


but inside pcre_newline.c:
  BOOL _pcre_is_newline(USPTR ptr, int type, USPTR endptr,
                        int *lenptr, BOOL utf8)
  BOOL _pcre_was_newline(USPTR ptr, int type, USPTR startptr,
                         int *lenptr, BOOL utf8)


This difference in casting confuses some C++ compilers, f.e. SunCC
recognizes above declarations as different functions and generates
broken code for hbpcre.
It should be fixed to use the same declaration 'const uschar *' or
'USPTR' in both versions.

Brgds,
Viktor


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email