[MDEV-23926] Fix warnings generated during compilation of plugin/auth_pam/mapper/pam_user_map.c on MacOS Created: 2020-10-09  Updated: 2020-10-23  Resolved: 2020-10-23

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.2.34, 10.3.25, 10.4.15, 10.5.6, 10.6
Fix Version/s: 10.2.35, 10.3.26, 10.4.16, 10.5.7

Type: Bug Priority: Major
Reporter: Dmitry Shulga Assignee: Dmitry Shulga
Resolution: Fixed Votes: 0
Labels: None


 Description   

On compiling the file plugin/auth_pam/mapper/pam_user_map.c on MacOS the following warning are generated.

In case MariaDB serer is build with -DCMAKE_BUILD_TYPE=Debug it results in build error.
In other words, debug build can't be finished successfully on MacOS.

 88%] Building C object plugin/auth_pam/CMakeFiles/pam_user_map.dir/mapper/pam_user_map.c.o
/Users/shulga/projects/mariadb/server-10.2/plugin/auth_pam/mapper/pam_user_map.c:87:41: error: passing
      'gid_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types
      with different sign [-Werror,-Wpointer-sign]
  if (getgrouplist(user, user_group_id, loc_groups, &ng) < 0)
                                        ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/unistd.h:650:43: note:
      passing argument to parameter here
int      getgrouplist(const char *, int, int *, int *);
                                              ^
/Users/shulga/projects/mariadb/server-10.2/plugin/auth_pam/mapper/pam_user_map.c:95:46: error: passing
      'gid_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types
      with different sign [-Werror,-Wpointer-sign]
    (void) getgrouplist(user, user_group_id, loc_groups, &ng);
                                             ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/includ
e/unistd.h:650:43: note:
      passing argument to parameter here
int      getgrouplist(const char *, int, int *, int *);
                                              ^
2 errors generated.


Generated at Thu Feb 08 09:26:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.