# this exists can be found on issue #2400
export CFG_COMPILER_TRIPLE
+# The standard libraries should be held up to a higher standard than any old
+# code, make sure that these common warnings are denied by default. These can
+# be overridden during development temporarily. For stage0, we allow all these
+# to suppress warnings which may be bugs in stage0 (should be fixed in stage1+)
+# NOTE: add "-A warnings" after snapshot to WFLAGS_ST0
+WFLAGS_ST0 = -A unrecognized-lint
+WFLAGS_ST1 = -D warnings
+WFLAGS_ST2 = -D warnings
+
# TARGET_STAGE_N template: This defines how target artifacts are built
# for all stage/target architecture combinations. The arguments:
# $(1) is the stage
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
| $$(TLIB$(1)_T_$(2)_H_$(3))/
@$$(call E, compile_and_link: $$@)
- $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
+ $$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) -o $$@ $$< && touch $$@
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2)): \
$$(EXTRALIB_CRATE) $$(EXTRALIB_INPUTS) \
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
| $$(TLIB$(1)_T_$(2)_H_$(3))/
@$$(call E, compile_and_link: $$@)
- $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
+ $$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) -o $$@ $$< && touch $$@
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)): \
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
use core::prelude::*;
use core::io;
-use core::os;
-use terminfo::*;
-use terminfo::searcher::open;
-use terminfo::parser::compiled::parse;
-use terminfo::parm::{expand, Number, Variables};
+#[cfg(not(target_os = "win32"))] use core::os;
+#[cfg(not(target_os = "win32"))] use terminfo::*;
+#[cfg(not(target_os = "win32"))] use terminfo::searcher::open;
+#[cfg(not(target_os = "win32"))] use terminfo::parser::compiled::parse;
+#[cfg(not(target_os = "win32"))] use terminfo::parm::{expand, Number, Variables};
// FIXME (#2807): Windows support.
return Ok(Terminal {out: out, color_supported: false});
}
- pub fn fg(&self, color: u8) {
+ pub fn fg(&self, _color: u8) {
}
- pub fn bg(&self, color: u8) {
+ pub fn bg(&self, _color: u8) {
}
pub fn reset(&self) {
pub mod os {
pub mod common {
pub mod posix01 {
- use libc::types::os::arch::c95::{c_int, c_short};
+ use libc::types::os::arch::c95::c_short;
use libc::types::os::arch::extra::{int64, time64_t};
use libc::types::os::arch::posix88::{dev_t, ino_t};
use libc::types::os::arch::posix88::mode_t;
use iterator::IteratorUtil;
use libc;
use libc::{c_char, c_void, c_int, size_t};
-use libc::{mode_t, FILE};
+use libc::FILE;
use local_data;
-use option;
use option::{Some, None};
use os;
use prelude::*;
unsafe {
#[cfg(windows)]
unsafe fn get_env_pairs() -> ~[~str] {
- use libc::types::os::arch::extra::LPTCH;
use libc::funcs::extra::kernel32::{
GetEnvironmentStringsA,
FreeEnvironmentStringsA
do with_env_lock {
let s = str::as_c_str(n, |s| libc::getenv(s));
if ptr::null::<u8>() == cast::transmute(s) {
- option::None::<~str>
+ None::<~str>
} else {
let s = cast::transmute(s);
- option::Some::<~str>(str::raw::from_buf(s))
+ Some::<~str>(str::raw::from_buf(s))
}
}
}
#[cfg(windows)]
fn secondary() -> Option<Path> {
- do getenv(~"USERPROFILE").chain |p| {
+ do getenv("USERPROFILE").chain |p| {
if !p.is_empty() {
Some(Path(p))
} else {
use os::win32::as_utf16_p;
// FIXME: turn mode into something useful? #2623
do as_utf16_p(p.to_str()) |buf| {
- libc::CreateDirectoryW(buf, unsafe {
- cast::transmute(0)
- })
+ libc::CreateDirectoryW(buf, cast::transmute(0))
!= (0 as libc::BOOL)
}
}
fn mkdir(p: &Path, mode: c_int) -> bool {
unsafe {
do as_c_charp(p.to_str()) |c| {
- libc::mkdir(c, mode as mode_t) == (0 as c_int)
+ libc::mkdir(c, mode as libc::mode_t) == (0 as c_int)
}
}
}
}
#[cfg(windows)]
unsafe fn get_list(p: &Path) -> ~[~str] {
- use libc::types::os::arch::extra::{LPCTSTR, HANDLE, BOOL};
use libc::consts::os::extra::INVALID_HANDLE_VALUE;
use libc::wcslen;
use libc::funcs::extra::kernel32::{
// Give the new file the old file's permissions
if do str::as_c_str(to.to_str()) |to_buf| {
- libc::chmod(to_buf, from_mode as mode_t)
+ libc::chmod(to_buf, from_mode as libc::mode_t)
} != 0 {
return false; // should be a condition...
}
/// Returns a vector of Path objects that match the given glob pattern
#[cfg(target_os = "win32")]
-pub fn glob(pattern: &str) -> ~[Path] {
+pub fn glob(_pattern: &str) -> ~[Path] {
fail!("glob() is unimplemented on Windows")
}
#[cfg(windows)]
pub unsafe fn create(key: &mut Key) {
static TLS_OUT_OF_INDEXES: DWORD = 0xFFFFFFFF;
- *key = unsafe { TlsAlloc() };
+ *key = TlsAlloc();
assert!(*key != TLS_OUT_OF_INDEXES);
}
#[cfg(windows)]
pub unsafe fn set(key: Key, value: *mut c_void) {
- unsafe { assert!(0 != TlsSetValue(key, value)) }
+ assert!(0 != TlsSetValue(key, value))
}
#[cfg(windows)]
#[allow(missing_doc)];
-use iterator::IteratorUtil;
use cast;
use comm::{stream, SharedChan, GenericChan, GenericPort};
-use int;
use io;
+use iterator::IteratorUtil;
use libc::{pid_t, c_void, c_int};
use libc;
use option::{Some, None};
use libc::funcs::extra::msvcrt::get_osfhandle;
use sys;
- use uint;
unsafe {
use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
use libc::funcs::bsd44::getdtablesize;
+ use int;
mod rustrt {
use libc::c_void;
use util;
use unstable::sync::{Exclusive, exclusive};
use rt::local::Local;
-use iterator::{IteratorUtil};
+use iterator::IteratorUtil;
#[cfg(test)] use task::default_task_opts;
#[cfg(test)] use comm;
use str::OwnedStr;
use hashmap::HashMap;
use hashmap::HashSet;
-use iterator::IteratorUtil;
use hash::Hash;
+use iterator::IteratorUtil;
use cmp::Eq;
use vec::ImmutableVector;
mod tests {
use hashmap::HashMap;
use hashmap::HashSet;
- use container::{Set,Map};
+ use container::{Set, Map};
#[test]
fn test_simple_types() {
assert_eq!(1i.to_str(), ~"1");
use libc;
use path;
use ptr;
- use str;
use task;
use result::*;
}
pub unsafe fn open_internal() -> *libc::c_void {
- let mut handle = ptr::null();
+ let handle = ptr::null();
GetModuleHandleExW(0 as libc::DWORD, ptr::null(), &handle as **libc::c_void);
handle
}