pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.04k stars 2.11k forks source link

MacOS ARM64 build warning: 'OS_CODE' macro redefined #4585

Closed JackyWoo closed 2 weeks ago

JackyWoo commented 2 weeks ago

Describe the bug

Env: MacOS 14.4.1 ARM64 clang 18

Build project with cmake.

In file included from /Users/wujianchao5/project/jd/poco/Foundation/src/adler32.c:8:
/Users/wujianchao5/project/jd/poco/Foundation/src/zutil.h:170:11: warning: 'OS_CODE' macro redefined [-Wmacro-redefined]
  170 | #  define OS_CODE 19
      |           ^
/Users/wujianchao5/project/jd/poco/Foundation/src/zutil.h:141:11: note: previous definition is here
  141 | #  define OS_CODE  7
      |           ^
1 warning generated.
andrewauclair commented 2 weeks ago

zutil.h is part of zlib which is a 3rd Party library Poco uses. Looks like this code has changed slightly in the latest code, maybe it doesn't cause the issue. Line 40 changed from #if defined(MACOS) || defined(TARGET_OS_MAC) to #if defined(MACOS).

matejk commented 2 weeks ago

Automated compile and testrun actions on GitHub (M1 MacOS) complete just fine just fine.

https://github.com/pocoproject/poco/actions/runs/9463808045/job/26069810114

I also just tested again the code from branch 1.13.3 on my M1 MacBook Pro and did not see any issues that you report.

matejk commented 2 weeks ago

Where did you install clang 18 from?

Latest XCode 15.4 installs clang 15.

matejk commented 2 weeks ago

@JackyWoo, would you try compiling the code from PR #4587?

JackyWoo commented 2 weeks ago

@matejk buid success, thanks.