Skip to content

src: squelch unused function warnings in util.h #9083

Closed
@bnoordhuis

Description

Paper-cut issue. When you include util.h but not util-inl.h, you get the following warnings:

$ echo -e '#include "util.h" \n int main(){}' | \
  g++ -DNODE_WANT_INTERNALS=1 -Ideps/v8/include -Ideps/uv/include -Isrc \
      -Wall -Wextra -Wno-unused-parameter -x c++ -
In file included from <stdin>:1:0:
src/util.h:37:11: warning: inline function 'T* node::Malloc(size_t) [with T = char; size_t = long unsigned int]' used but never defined
 inline T* Malloc(size_t n);
           ^~~~~~
src/util.h:39:11: warning: inline function 'T* node::Calloc(size_t) [with T = char; size_t = long unsigned int]' used but never defined
 inline T* Calloc(size_t n);
           ^~~~~~
src/util.h:28:11: warning: inline function 'T* node::UncheckedMalloc(size_t) [with T = char; size_t = long unsigned int]' used but never defined
 inline T* UncheckedMalloc(size_t n);
           ^~~~~~~~~~~~~~~
src/util.h:30:11: warning: inline function 'T* node::UncheckedCalloc(size_t) [with T = char; size_t = long unsigned int]' used but never defined
 inline T* UncheckedCalloc(size_t n);
           ^~~~~~~~~~~~~~~

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions