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

__attribute__((unused)) causes MSVC 2008 C4113 and C4047 #64

Closed
imzyxwvu opened this issue Sep 30, 2014 · 4 comments
Closed

__attribute__((unused)) causes MSVC 2008 C4113 and C4047 #64

imzyxwvu opened this issue Sep 30, 2014 · 4 comments

Comments

@imzyxwvu
Copy link
Contributor

Branch: uv-update-1.0.0. MSVC doesn't support some C99 and GNU C features, so attribute((unused)) caused lots of warnings and some errors.

process.c:

        int fd; // should the type of this be replaced with uv_os_fd_t? MSVC reports this.
        uv_stream_t* stream = luv_check_stream(L, -1);
        int err = uv_fileno((uv_handle_t*)stream, &fd);

And util.c:

static void luv_resume_with_status(lua_State* L, int status, int nargs) {
 ...
 return luv_resume(L, 1 + nargs); // this is a void function but it has a return statement
}

And I wonder there is no co-routine design in libuv. Why it called Lua co-routine APIs? If we implement the co-routine support in C code, it won't be a BARE binding. I think co-routine wrapping should be done in Lua.

@creationix
Copy link
Member

Should we have a new opaque type for when using FD? I don't think the windows equivalent can be represented directly as an integer.

@creationix
Copy link
Member

Though some APIs that expect stdio FDs expect the integers 0, 1, 2 and libuv translates these integers to whatever is native on the platform.

@imzyxwvu
Copy link
Contributor Author

imzyxwvu commented Oct 1, 2014

It seems that libuv has changed its design about FDs at v1.0. Before that version int is used for FDs.

@creationix
Copy link
Member

Ok, I changed my linter so I don't need those GCC markers. If there are any left I didn't remove, it's a bug. I'm sure I'll find them as I move to building on windows.

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

2 participants