Thread: Strange error messages

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    23

    Strange error messages

    Hi All
    I am using IBM C compiler on the mainframe to compile some code that would be published as open source. I have in my program many (over 40)simple function definitions with the purpose of hiding the original function name under a new name (for mainframe related reasons). I have the appropriate 'extern' statements elsewhere in the program. Most cases, but 6, have no problem, but these 6 cause me compile warnings that I do not understand. The errors are of two types. Please see the below:
    Code:
    int32_t SERIADCD(pcre2_code **codes,                              
             int32_t number_of_codes, const uint32_t *bytes,          
             pcre2_general_context *gcontext)                         
    {                                                                 
         return pcre2_serialize_decode(codes,                         
             number_of_codes, bytes,                                  
    ..........................a.......................................
    =====> a - CCN3280 Function argument assignment between types "const unsigned char*" and "const unsigned  
                       int*" is not allowed.                          
             gcontext);                                               
    }
    Could anybody make sense of this warning.

    Another type of error is more subtle:
    Code:
    void MATCHDCR(uint32_t ovecsize,                                                
             pcre2_general_context *gcontext)                                       
    {                                                                               
        return pcre2_match_data_create(ovecsize,                                    
        return pcre2_match_data_create_8(ovecsize,                                  
    ....................................a...........................................
    =====> a - CCN4332 A function with return type "void" may not return a value of type "pointer to an
                       incomplete type".                                            
            gcontext);                                                              
    }
    I'll try to describe the subtle point. Internally all functions are described in macros that add '_8' to the name, but that should not appear in my program and indeed in most cases, this does not happen. Here, I've made a subtle mistake that caused the _8 to appear, but I cannot find that mistake.

    As an illustration, I'll show here a function that compile perfectly without any problem:
    Code:
    int MATCH2(const pcre2_code *code, PCRE2_SPTR subject,    
             PCRE2_SIZE length, PCRE2_SIZE startoffset,       
             uint32_t options, pcre2_match_data *match_data,  
             pcre2_match_context *mcontext)                   
    {                                                         
        return pcre2_match(code, subject,                     
             length, startoffset,                             
             options, match_data,                             
             mcontext);                                       
    }
    Thanks
    ZA

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    704
    You have not provided enough information for us to determine what is the problem.

    We would need to see the function declarations if not the definitions for the functions, to determine the data types of the function parameters, and the data return type, and the declarations of any other data that might be causing the warnings. Also if you are casting any of the data.

    For example in the first example,
    "const unsigned char*" and "const unsigned int*"
    you appear to be passing a "const unsigned char*" to a function defined to take a "const unsigned int*"! Incompatible types.

    Generally you should post a complete program small enough to replicate the problem, so we can compile and examine the errors and/or warnings.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    23
    Thank you... you actually guided me to the right direction. I trusted the documentation rather than looking at the actual function definition... my bad.
    ZA

  4. #4
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    704
    Quote Originally Posted by zatlas1 View Post
    Thank you... you actually guided me to the right direction. I trusted the documentation rather than looking at the actual function definition... my bad.
    ZA
    Not your bad if their docs don't match their code! The docs should be relied on! Please report the discrepancy back to the programmers or company that wrote the code.

  5. #5
    Registered User
    Join Date
    Jul 2010
    Posts
    23
    Will do. Thank you again
    ZA

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-16-2015, 10:36 AM
  2. 3 Error messages?
    By hottiefee in forum C++ Programming
    Replies: 3
    Last Post: 11-01-2010, 02:56 PM
  3. Strange gcc warning messages with derived classes
    By skewray in forum C++ Programming
    Replies: 5
    Last Post: 09-23-2007, 04:46 AM
  4. XP error messages
    By chris1985 in forum Windows Programming
    Replies: 2
    Last Post: 01-12-2005, 02:37 PM
  5. Help with error messages
    By chris1985 in forum Windows Programming
    Replies: 1
    Last Post: 01-11-2005, 03:39 PM