-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make utmp(x) support more platforms #353
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
Conversation
#[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")] | ||
#[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")] | ||
pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, | ||
result: *mut *mut ::dirent) -> ::c_int; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite these being deprecated, we can't remove these due to backwards compatibility, could these stick around for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to ignore them in the tests.
@@ -350,6 +353,9 @@ fn main() { | |||
cfg.skip_fn(move |name| { | |||
// skip those that are manually verified | |||
match name { | |||
// glibc-2.24 deprecates these functions | |||
"readdir_r" | "readdir64_r" => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these still be tested and the deprecation warning allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is pasted below.
out/all.c: In function ‘__test_fn_readdir_r’:
out/all.c:2061:17: error: ‘readdir_r’ is deprecated [-Werror=deprecated-declarations]
return readdir_r;
^~~~~~
out/all.c:16:0:
/usr/include/dirent.h:183:12: note: declared here
extern int readdir_r (DIR *__restrict __dirp,
^~~~~~~~~
Perhaps we can pass -Wno-deprecated-declarations
to the compiler? Is that acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me!
Got it. It is written in Cargo.lock
|
glibc-2.24 deprecates readdir_r() and readdir64_r()
@alexcrichton could be merge now |
Awesome, thanks! |
Cast function item to function pointer in order to appease compiler. This is necessary because of compiler changes. For further information look at rust-lang/rust#19925. This solves rust-lang#346. I know that there are other problems with the affected function. We are thinking about how to best pass the arguments to the function and we don't want to define the ffi's ourselves. However, I would like to get the warning out of our tree as soon as possible. We do not need to wait for our polish.
…ang#353) * migrate to rustfmt-preview and require rustfmt to pass * reformat with rustfmt-preview
Also ignored deprecated functions
readdir_r
andreaddir64_r
that fail the tests.