rust/src/libstd
Geoffrey Thomas 058a0f0b0b liblibc: Fix prototype of functions taking char *const argv[]
The execv family of functions do not modify their arguments, so they do
not need mutable pointers. The C prototypes take a constant array of
mutable C-strings, but that's a legacy quirk from before C had const
(since C string literals have type `char *`). The Rust prototypes had
`*mut` in the wrong place, anyway: to match the C prototypes, it should
have been `*const *mut c_char`. But it is safe to pass constant strings
(like string literals) to these functions.

getopt is a special case, since GNU getopt modifies its arguments
despite the `const` claim in the prototype. It is apparently only
well-defined to call getopt on the actual argc and argv parameters
passed to main, anyway. Change it to take `*mut *mut c_char` for an
attempt at safety, but probably nobody should be using it from Rust,
since there's no great way to get at the parameters as passed to main.

Also fix the one caller of execvp in libstd, which now no longer needs
an unsafe cast.

Fixes #16290.
2015-06-19 23:34:37 -04:00
..
collections Auto merge of #26192 - alexcrichton:features-clean, r=aturon 2015-06-18 19:14:52 +00:00
ffi Add comment about stabilizing CString::from_ptr 2015-06-17 09:07:17 -07:00
io More test fixes and fallout of stability changes 2015-06-17 09:07:17 -07:00
net Auto merge of #26190 - Veedrac:no-iter, r=alexcrichton 2015-06-11 18:10:08 +00:00
num std: Split the std_misc feature 2015-06-17 09:06:59 -07:00
os std: Stabilize a number of new fs features 2015-06-09 17:44:13 -07:00
prelude Rollup merge of #25224 - brson:stddoc, r=steveklabnik 2015-05-13 00:52:48 -04:00
rand remove references to IoResult 2015-05-28 12:51:01 -04:00
rt More test fixes and fallout of stability changes 2015-06-17 09:07:17 -07:00
sync More test fixes and fallout of stability changes 2015-06-17 09:07:17 -07:00
sys liblibc: Fix prototype of functions taking char *const argv[] 2015-06-19 23:34:37 -04:00
thread Fix libstd tests 2015-06-18 10:51:31 -07:00
time std: Redesign Duration, implementing RFC 1040 2015-05-13 17:50:58 -07:00
array.rs rustdoc: Support for "array" primitive 2015-03-23 14:02:34 -07:00
ascii.rs std: Split the std_misc feature 2015-06-17 09:06:59 -07:00
bool.rs Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
dynamic_lib.rs std: Split the std_misc feature 2015-06-17 09:06:59 -07:00
env.rs std: Deprecate the exit_status feature 2015-06-17 09:07:17 -07:00
error.rs std: Hide some internal functions more aggressively 2015-06-17 09:07:17 -07:00
fs.rs std: Stabilize a number of new fs features 2015-06-09 17:44:13 -07:00
lib.rs Fix libstd tests 2015-06-18 10:51:31 -07:00
macros.rs std: Split the std_misc feature 2015-06-17 09:06:59 -07:00
panicking.rs std: Split the std_misc feature 2015-06-17 09:06:59 -07:00
path.rs Auto merge of #25736 - tshepang:path-nits, r=steveklabnik 2015-05-25 01:56:48 +00:00
process.rs std: Tweak process raising/lowering implementations 2015-06-09 17:48:10 -07:00
rtdeps.rs std: Split the std_misc feature 2015-06-17 09:06:59 -07:00
thunk.rs std: Deprecate the thunk module 2015-06-17 09:07:17 -07:00
tuple.rs Remove doc-comment default::Default imports 2015-04-22 09:42:36 -04:00
unit.rs grandfathered -> rust1 2015-01-23 21:48:20 -08:00