lightning icon indicating copy to clipboard operation
lightning copied to clipboard

error: 'vsprintf' is deprecated

Open enaples opened this issue 4 weeks ago • 3 comments

Description

During compilation on macOS M5 Tahoe 26.1 I get compilation error of the new release candidate (v25.12rc3) following the steps listed in ci.yamlfile for testing purpouses. The error is the following:

ccan/ccan/json_out/json_out.c:249:3: error: 'vsprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead. [-Werror,-Wdeprecated-declarations]
  249 |                 vsprintf(dst + quote, fmt, ap2);
      |                 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:298:1: note: 'vsprintf' has been explicitly marked deprecated here
  298 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:227:48: note: expanded from macro '__deprecated_msg'
  227 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
1 error generated.

Steps to reproduce

  1. Checkout on the v25.12rc3 tag
  2. Install all dependencies listed in the installation guide for development purpouse
  3. Run uv sync --all-extras --all-groups --frozen
  4. Run ./configure --enable-debugbuild --enable-fuzzing --enable-address-sanitizer --enable-ub-sanitizer --disable-valgrind CC=clang as reported in ci.yaml
  5. Run uv run make -j $(nproc)

Note

I know that CI runs on ubuntu-22 and it run successfully last time (17th Nov I think). But I think it's worth reporting the issue.

enaples avatar Dec 03 '25 14:12 enaples

Thank you so much for raising this macOS issue! This really improves the developer experience for all cln devs using macOS!

I've created a PR to fix this #8759

sangbida avatar Dec 04 '25 22:12 sangbida

I wonder if we should avoid -Werror if we're not doing a debug build?

rustyrussell avatar Dec 05 '25 03:12 rustyrussell

We could do that! Although, the -Werror has helped me catch some bugs early on, so I do like having it there. I also fear that if I had a warning instead of an error, I may ignore it 🫣

sangbida avatar Dec 05 '25 03:12 sangbida