From a90205432ca0c731faaa0bde8fa74bcd076de616 Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 18 Dec 2013 14:53:36 +0000 Subject: gcc: add Apple compatible -Wnewline-eof GCC 4.2 and previous have always warned about "No newline at end of file". Upstream GCC removed the warning completely but Apple made it an optional warning. Adopt it for compatibility with older GCC and clang. While here, add comment to complement r258712. Obtained from: Apple Inc. (Apple GCC 4.2 - 5531) MFC after: 1 week --- contrib/gcclibs/libcpp/charset.c | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/gcclibs/libcpp/charset.c') diff --git a/contrib/gcclibs/libcpp/charset.c b/contrib/gcclibs/libcpp/charset.c index 6361f8c..009106b 100644 --- a/contrib/gcclibs/libcpp/charset.c +++ b/contrib/gcclibs/libcpp/charset.c @@ -1628,6 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, const char *input_charset, terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ + /* APPLE LOCAL don't access to.text[-1] radar 6121572 */ if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else -- cgit v1.1