Giter Club home page Giter Club logo

Comments (8)

skypjack avatar skypjack commented on June 26, 2024 1

I'm having a couple of other warnings too.

@aloisklink I'm open to look into a PR if you like. Otherwise, I can try this list and fix them when I'm back on full bandwidth (that is next week probably, sort of at least).

from uvw.

aloisklink avatar aloisklink commented on June 26, 2024 1

Otherwise, I can try this list and fix them when I'm back on full bandwidth (that is next week probably, sort of at least).

Sounds good! I'll give it a try if I find the time. Fixing the warnings should be the easy part, the hard part will be enabling all of the warnings in CI, but only for compilers that support them, in order to prevent future PRs from adding new warnings.


By the way, @falsycat, CMake 3.25 added support for the SYSTEM property on directories and targets.

I'm not sure how you're using uvw, but if you're using CPM, you can do something like:

CPMAddPackage(uvw
  NAME uvw
  VERSION 3.2.0
  SYSTEM YES # this is the important line!!
  uvw
  URL https://github.com/skypjack/uvw/archive/refs/tags/v3.2.0_libuv_v1.46.tar.gz
  URL_HASH SHA3_256=0b82039ac6fcff490caeb85b77408eb925146690cb812c4e9303757263d8ce12
  EXCLUDE_FROM_ALL YES # to avoid building uvw tests/installs
)

Or if you're using FetchContent, something like:

FetchContent_Declare(uvw
  GIT_REPOSITORY https://github.com/skypjack/uvw.git
  GIT_TAG 7fda7c5072cdc1b78fc62b1cb1f2842e465cb02b # v3.2.0_libuv_v1.46
  SYSTEM # this is the important line!!
)
FetchContent_MakeAvailable(uvw)

from uvw.

falsycat avatar falsycat commented on June 26, 2024 1

Or if you're using FetchContent, something like:

FetchContent_Declare(uvw
  GIT_REPOSITORY https://github.com/skypjack/uvw.git
  GIT_TAG 7fda7c5072cdc1b78fc62b1cb1f2842e465cb02b # v3.2.0_libuv_v1.46
  SYSTEM # this is the important line!!
)
FetchContent_MakeAvailable(uvw)

I didn't know that! Thank you!

from uvw.

skypjack avatar skypjack commented on June 26, 2024

What warnings exactly? I don't see them on the CI and I can't reproduce them without a bit of context.

from uvw.

falsycat avatar falsycat commented on June 26, 2024

@skypjack

thank you for your reply!

warning:

/Users/falsycat/Repo/nf7/build/_deps/uvw-src/src/uvw/uv_type.hpp:19:34: error: unused parameter 'token' [-Werror=unused-parameter]
   19 |     explicit uv_type(loop::token token, std::shared_ptr<loop> ref) noexcept
      |                      ~~~~~~~~~~~~^~~~~

full compile command displayed by make VERBOSE=1:

cd /Users/falsycat/Repo/nf7/build/core && /opt/homebrew/bin/g++-13 -DUVW_AS_LIB -I/Users/falsycat/Repo/nf7/build -I/Users/falsycat/Repo/nf7 -I/Users/falsycat/Repo/nf7/build/_deps/uvw-src/src -I/Users/falsycat/Repo/nf7/build/_deps/libuv-src/include -isystem /Users/falsycat/Repo/nf7/build/_deps/luajit-src/src -g -std=gnu++23 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk -mmacosx-version-min=11.0 -Wall -Wextra -Wpedantic -Werror -MD -MT core/CMakeFiles/nf7_core.dir/uv/concurrency.cc.o -MF CMakeFiles/nf7_core.dir/uv/concurrency.cc.o.d -o CMakeFiles/nf7_core.dir/uv/concurrency.cc.o -c /Users/falsycat/Repo/nf7/core/uv/concurrency.cc

CMake script about uvw:

FetchContent_Declare(
  uvw
  GIT_REPOSITORY https://github.com/skypjack/uvw.git
  GIT_TAG        v3.2.0_libuv_v1.46
)
set(BUILD_UVW_LIBS ON)
FetchContent_MakeAvailable(uvw)

compiler version:

$ g++-13 --version
g++-13 (Homebrew GCC 13.1.0) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

the warning can be suppressed by adding SYSTEM after ${LIB_NAME} in the following code:

uvw/src/CMakeLists.txt

Lines 38 to 43 in 7fda7c5

target_include_directories(
${LIB_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

from uvw.

skypjack avatar skypjack commented on June 26, 2024

Is this the only warning you have? Fixing it in code looks both reasonable and trivial in any case.

from uvw.

falsycat avatar falsycat commented on June 26, 2024

@skypjack

I know it's the best, however, I think thirdparty libraries shouldn't make a warning to reduce a time of library user to deal with new warnings caused by compiler differences, like this issue.

SYSTEM keyword seems to suppress warnings only when the headers are included by #include <...> (not #include "...").
So this solution doesn't affect to developers unless using #include <..>.

(that warning was all I saw)

from uvw.

aloisklink avatar aloisklink commented on June 26, 2024

Is this the only warning you have?

I'm having a couple of other warnings too.

I'm using the following compiler warnings (these are a subset of the default compiler flags from the cmake-init project, see https://github.com/friendlyanon/cmake-init/blob/aa42211c79ab5117b05a2d9f795427f078a0a3d5/cmake-init/templates/common/CMakePresets.json#L88):

add_compile_options(
  # Error on all C/C++ warnings if making a Debug build
  $<$<CONFIG:Debug>:-Werror>
  -Wall
  -Wextra
  -Wpedantic
  -Wconversion
  -Wsign-conversion
  -Wcast-qual
  -Wformat=2
  -Wundef
  -Werror=float-equal
  -Wshadow
  -Wcast-align
  -Wunused
  -Wnull-dereference
  -Wdouble-promotion
  -Wimplicit-fallthrough
  $<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>
  $<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>
  $<$<COMPILE_LANGUAGE:CXX>:-Wnon-virtual-dtor>
  $<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
)

Most of the warnings look pretty minor/trivial to fix (I might even make a PR if I have free time this weekend!).

from uvw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.