Skip to content

errno conflicts #53

@laysakura

Description

@laysakura

Describe the bug

springql.h uses errno as an argument name but it conflicts with that in errno.h.

To Reproduce

static inline void abort_with_report_()
{
    SpringErrno errno_;
    char errmsg[1024];
    spring_last_err(&errno_, errmsg, 1024);
    fprintf(stderr, "Error occurred (%d): %s", errno_, errmsg);
    abort();
}
./springql/assert.h: In functionabort_with_report_’:                                                                                                              
./springql/assert.h:10:21: warning: passing argument 1 ofspring_last_errfrom incompatible pointer type [-Wincompatible-pointer-types]                           
   10 |     spring_last_err(&errno, errmsg, 1024);                                                                                                                                                                                                    
      |                     ^~~~~~~                                                                                                                                                                                                                    
      |                     |                                                                                                                                                                                                                          
      |                     SpringErrno *                                                                                                                                                                                                              
In file included from app_func/telegraphic_message.c:20:                                                                                                            
./springql.h:436:39: note: expectedenum SpringErrno ** (*)()’ but argument is of typeSpringErrno *436 | int spring_last_err(enum SpringErrno *errno,     

Expected behavior

No warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions