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

C4003: not enough arguments for function-like macro invocati on 'max' #1980

Closed
m-kurbanov opened this issue Jun 10, 2020 · 0 comments
Closed

Comments

@m-kurbanov
Copy link

After upgrading to 1.73.0 () from 1.71.0 I'm getting the following warning/error when compiling:

include/boost/beast/core/impl/file_stdio.ipp(273,71): warning C4003: not enough arguments for function-like macro invocati on 'max'
include/boost/beast/core/impl/file_stdio.ipp(273,71): error C2589: '(': illegal token on right side of '::'
include/boost/beast/core/impl/file_stdio.ipp(275,7): error C2062: type 'unknown-type' unexpected
include/boost/beast/core/impl/file_stdio.ipp(273): error C2144: syntax error: 'unknown-type' should be preceded by '('
include/boost/beast/core/impl/file_stdio.ipp(273,77): error C2059: syntax error: ')'
include/boost/beast/core/impl/file_stdio.ipp(274,5): error C2143: syntax error: missing ';' before '{'

if(offset > static_cast<std::uint64_t>(std::numeric_limits<long>::max()))

Maybe you forgot to wrap the call to std::numeric_limits::max() in parenthesis (from #1687):
if (offset > static_cast<std::uint64_t>((std::numeric_limits<long>::max)()))

--- a/include/boost/beast/core/impl/file_stdio.ipp
+++ b/include/boost/beast/core/impl/file_stdio.ipp
@@ -270,7 +270,7 @@ seek(std::uint64_t offset, error_code& ec)
         ec = make_error_code(errc::bad_file_descriptor);
         return;
     }
-    if(offset > static_cast<std::uint64_t>(std::numeric_limits<long>::max()))
+    if(offset > static_cast<std::uint64_t>((std::numeric_limits<long>::max)()))
     {
         ec = make_error_code(errc::invalid_seek);
         return;

Build info:

Windows 10.0.18363
Visual Studio 16 2019
MSVC x64 19.24.28316.0
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 a pull request may close this issue.

1 participant