Skip to content

Fix compilation errors for modern GCC compilers#99

Open
stanstrup wants to merge 1 commit intodselivanov:masterfrom
stanstrup:master
Open

Fix compilation errors for modern GCC compilers#99
stanstrup wants to merge 1 commit intodselivanov:masterfrom
stanstrup:master

Conversation

@stanstrup
Copy link
Copy Markdown

@stanstrup stanstrup commented Dec 1, 2025

Fixed compilation errors that prevented building with modern GCC versions due to deprecated R memory allocation macros and format-security warnings.

Changes:

  • Replaced R's Calloc/Realloc/Free macros with standard C calloc/realloc/free
  • Fixed format-security errors in error() calls by adding format specifiers
  • Added stdlib.h include for standard C memory functions

Fixed in the following files:

  • src/api.c: Memory allocation helpers and error handler
  • src/api_bson.c: Multiple Calloc/Free calls and MAXDIM error format
  • src/api_mongo.c: Calloc/Free calls and connection error format
  • src/api_gridfs.c: GridFS memory allocation calls
  • src/utility.c: BSON object allocation

Package now compiles successfully with GCC 13.3.0 and -Werror=format-security.

Fixed compilation errors that prevented building with modern GCC versions
due to deprecated R memory allocation macros and format-security warnings.

Changes:
- Replaced R's Calloc/Realloc/Free macros with standard C calloc/realloc/free
- Fixed format-security errors in error() calls by adding format specifiers
- Added stdlib.h include for standard C memory functions

Fixed in the following files:
- src/api.c: Memory allocation helpers and error handler
- src/api_bson.c: Multiple Calloc/Free calls and MAXDIM error format
- src/api_mongo.c: Calloc/Free calls and connection error format
- src/api_gridfs.c: GridFS memory allocation calls
- src/utility.c: BSON object allocation

Package now compiles successfully with GCC 13.3.0 and -Werror=format-security.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant