Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(log): support nginx built without variadic macros #122

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

bavshin-f5
Copy link
Member

Fixed the error below, caused by a different signature of ngx_log_error_core when neither NGX_HAVE_C99_VARIADIC_MACROS nor nor NGX_HAVE_GCC_VARIADIC_MACROS is detected.
An example of affected configuration is MinGW with clang or gcc, where we skip most of the compiler feature checks.

error[E0061]: this function takes 5 arguments but 6 arguments were
supplied
     --> examples\awssig.rs:312:9
      |
312   |         ngx_log_debug_http!(request,  "headers {:?}",  headers);
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unexpected argument #6 of type `*const u8`
      |
note: expected `*mut i8`,  found `usize`

@bavshin-f5 bavshin-f5 marked this pull request as ready for review January 16, 2025 05:25
Copy link

@xeioex xeioex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good.

src/log.rs Outdated Show resolved Hide resolved
src/log.rs Outdated Show resolved Hide resolved
Fixed the error below, caused by a different signature of
`ngx_log_error_core` when neither `NGX_HAVE_C99_VARIADIC_MACROS` nor
nor `NGX_HAVE_GCC_VARIADIC_MACROS` is detected.
An example of affected configuration is MinGW with clang or gcc, where
we skip most of the compiler feature checks.

```
error[E0061]: this function takes 5 arguments but 6 arguments were
supplied
     --> examples\awssig.rs:312:9
      |
312   |         ngx_log_debug_http!(request,  "headers {:?}",  headers);
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unexpected argument nginx#6 of type `*const u8`
      |
note: expected `*mut i8`,  found `usize`
```
@bavshin-f5 bavshin-f5 merged commit aefeb69 into nginx:master Jan 16, 2025
10 checks passed
@bavshin-f5 bavshin-f5 deleted the logs-no-variadic branch January 16, 2025 17:41
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.

2 participants