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

compiler complains line 686 when --Wall enabled #286

Closed
szdytom opened this issue Aug 29, 2023 · 2 comments
Closed

compiler complains line 686 when --Wall enabled #286

szdytom opened this issue Aug 29, 2023 · 2 comments

Comments

@szdytom
Copy link

szdytom commented Aug 29, 2023

third-party/argparse/argparse.hpp: In function ‘std::ostream& argparse::operator<<(std::ostream&, const Argument&)’:
third-party/argparse/argparse.hpp:686:53: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const std::__cxx11::basic_string<char>::size_type’ {aka ‘const long unsigned int’} [-Wsign-compare]
  686 |     while ((pos = argument.m_help.find('\n', prev)) != std::string::npos) {
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
@Caya91
Copy link

Caya91 commented Oct 12, 2023

SRC = find.cc
OBJ = $(SRC:.cc=.o)
TGT = find
DEP = $(SRC:.cc=.d)

$(TGT): $(OBJ)
g++ -std=c++17 -o $@ $+

%.o: %.c Makefile
g++ -std=c++17 -Wall -Werror -MMD -c -o $@ $&lt;

clean:
rm -f $(OBJ) $(TGT) $(DEP)

-include $(DEP)


with this Makefile the warning doesn't come up

but if you write it like this, the warning comes up
%.o: %.cc Makefile
g++ -std=c++17 -Wall -Werror -MMD -c -o $@ $&lt;

@p-ranav
Copy link
Owner

p-ranav commented Oct 27, 2023

Appears to be fixed after this #292

@p-ranav p-ranav closed this as completed Oct 27, 2023
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

No branches or pull requests

3 participants