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

Remove unreachable code below FMT_THROW #361

Merged
merged 1 commit into from
Jul 21, 2016

Conversation

nmoehrle
Copy link
Contributor

Removes a compiler warning about unreachable code.

Sorry about the white spaces...

@vitaut
Copy link
Contributor

vitaut commented Jul 20, 2016

Thanks for the PR. Could you post the full warning message for reference as well as the compiler version and compile options if non-default?

@nmoehrle
Copy link
Contributor Author

The warning is produced by this call:

# cudafe --allow_managed --m64 --gnu_version=50301 --c++11 -tused
    --no_remove_unneeded_entities --device-c
    --gen_c_file_name "FILE.cudafe1.c" --stub_file_name "FILE.cudafe1.stub.c"
    --gen_device_file_name "FILE.cudafe1.gpu"
    --nv_arch "compute_20" --gen_module_id_file
    --module_id_file_name "FILE.module_id" --include_file_name "FILE.fatbin.c"
    "FILE.cpp1.ii"
fmt/format.h(2617): warning: statement is unreachable
          detected during:
            instantiation of "void fmt::internal::ArgFormatterBase<Impl, Char>::write(__nv_bool) [with Impl=fmt::ArgFormatter<char>, Char=char]" 
(1842): here
            instantiation of "void fmt::internal::ArgFormatterBase<Impl, Char>::visit_bool(__nv_bool) [with Impl=fmt::ArgFormatter<char>, Char=char]" 
(1532): here
            instantiation of "Result fmt::ArgVisitor<Impl, Result>::visit(const fmt::ArgVisitor<Impl, Result>::Arg &) [with Impl=fmt::ArgFormatter<char>, Result=void]" 
(3697): here
            instantiation of "const fmt::BasicFormatter<CharType, ArgFormatter>::Char *fmt::BasicFormatter<CharType, ArgFormatter>::format(const fmt::BasicFormatter<CharType, ArgFormatter>::Char *&, const fmt::internal::Arg &) [with CharType=char, ArgFormatter=fmt::ArgFormatter<char>]" 
(3718): here
            instantiation of "void fmt::BasicFormatter<CharType, ArgFormatter>::format(fmt::BasicCStringRef<CharType>) [with CharType=char, ArgFormatter=fmt::ArgFormatter<char>]" 
(2482): here
            instantiation of "void fmt::BasicWriter<Char>::write(fmt::BasicCStringRef<Char>, fmt::ArgList) [with Char=char]" 
(3144): here

I haven't been able to reproduce it with gcc so I think it is actually produced by cudafe (Cuda Language Front End) and not by the host compiler.

# cudafe -v
cudafe: NVIDIA (R) Cuda Language Front End
Portions Copyright (c) 2005-2014 NVIDIA Corporation
Portions Copyright (c) 1988-2014 Edison Design Group Inc.
Based on Edison Design Group C/C++ Front End, version 4.9 (Aug 11 2015 14:27:37)
Cuda compilation tools, release 7.5, V7.5.17

@vitaut vitaut merged commit 631ffef into fmtlib:master Jul 21, 2016
@vitaut
Copy link
Contributor

vitaut commented Jul 21, 2016

Merged, thanks!

@nmoehrle
Copy link
Contributor Author

Thank you! Your lib is just awesome :-)

Your decision to go with pythons format mini language... :-)
Apart from not having to learn something new, I just love the ability to quickly check format strings in the python interpreter without needing to compile.

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

Successfully merging this pull request may close these issues.

2 participants