Index: tools/xcw/bin/helenos-cc
===================================================================
--- tools/xcw/bin/helenos-cc	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ tools/xcw/bin/helenos-cc	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -41,5 +41,5 @@
 "$CC" \
     -O3 -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -finput-charset=UTF-8 \
-    -ffreestanding -fno-builtin -nostdlib -nostdinc \
+    -nostdlib \
     -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \
     -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings -ggdb \
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/Makefile.common	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -179,11 +179,15 @@
 	-O$(OPTIMIZATION) \
 	-ffunction-sections \
+	-fno-builtin-strftime \
 	-pipe \
 	-Wall \
 	-Wextra \
 	-Wno-unused-parameter \
+	-Wno-nonnull-compare \
 	-Wmissing-prototypes \
 	-Wwrite-strings \
 	-Werror-implicit-function-declaration
+
+# XXX: -fno-builtin-strftime is for a seemingly spurious format warning.
 
 ifeq ($(CONFIG_DEBUG),y)
@@ -211,9 +215,7 @@
 # Flags that should always be used, even for third-party software.
 COMMON_CPPFLAGS = \
-	-nostdinc \
 	-D__$(ENDIANESS)__
 
 COMMON_CFLAGS = \
-	-ffreestanding \
 	-nostdlib
 
Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/Makefile	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -34,5 +34,4 @@
 
 EXTRA_OUTPUT = $(START_FILES)
-EXTRA_TEST_CFLAGS = -Wno-deprecated-declarations
 LIBRARY = libc
 SOVERSION = 0.0
Index: uspace/lib/c/arch/amd64/Makefile.common
===================================================================
--- uspace/lib/c/arch/amd64/Makefile.common	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/arch/amd64/Makefile.common	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -27,12 +27,10 @@
 #
 
+# TODO: We need to implement DWARF unwinding and get rid of this flag.
 COMMON_CFLAGS += -fno-omit-frame-pointer
 
-# XXX: clang doesn't support this flag, but the optimization is OS-specific,
-#      so it isn't used for amd64-unknown-elf target.
-
-ifneq ($(COMPILER),clang)
-	COMMON_CFLAGS += -mno-tls-direct-seg-refs
-endif
+# XXX: This architecture requires unoptimized TLS pointer access,
+#      as with the GCC option `-mno-tls-direct-seg-refs`.
+#      The `amd64-helenos` target defaults to this behavior.
 
 LDFLAGS += -Wl,--gc-sections
Index: uspace/lib/c/arch/ia32/Makefile.common
===================================================================
--- uspace/lib/c/arch/ia32/Makefile.common	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/arch/ia32/Makefile.common	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -33,4 +33,8 @@
 endif
 
+# XXX: This architecture requires unoptimized TLS pointer access,
+#      as with the GCC option `-mno-tls-direct-seg-refs`.
+#      The `i686-helenos` target defaults to this behavior.
+
 COMMON_CFLAGS += -mno-tls-direct-seg-refs -fno-omit-frame-pointer
 LDFLAGS += -Wl,--gc-sections
Index: uspace/lib/c/generic/stdio/sprintf.c
===================================================================
--- uspace/lib/c/generic/stdio/sprintf.c	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/generic/stdio/sprintf.c	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -36,4 +36,5 @@
 #include <stdint.h>
 #include <stdio.h>
+#include <limits.h>
 
 /** Print formatted to string.
@@ -53,5 +54,5 @@
 	va_list args;
 	va_start(args, fmt);
-	rc = vsnprintf(s, SIZE_MAX, fmt, args);
+	rc = vsnprintf(s, INT_MAX, fmt, args);
 	va_end(args);
 
Index: uspace/lib/c/generic/stdio/vsprintf.c
===================================================================
--- uspace/lib/c/generic/stdio/vsprintf.c	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/generic/stdio/vsprintf.c	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -36,4 +36,5 @@
 #include <stdint.h>
 #include <stdio.h>
+#include <limits.h>
 
 /** Print formatted to string with arguments passed as va_list.
@@ -50,5 +51,5 @@
 int vsprintf(char *s, const char *fmt, va_list ap)
 {
-	return vsnprintf(s, SIZE_MAX, fmt, ap);
+	return vsnprintf(s, INT_MAX, fmt, ap);
 }
 
Index: uspace/lib/c/generic/time.c
===================================================================
--- uspace/lib/c/generic/time.c	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/generic/time.c	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -52,5 +52,5 @@
 #include <stats.h>
 
-#define ASCTIME_BUF_LEN  26
+#define ASCTIME_BUF_LEN  27
 
 #define HOURS_PER_DAY  24
Index: uspace/lib/c/include/math.h
===================================================================
--- uspace/lib/c/include/math.h	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/include/math.h	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -49,4 +49,9 @@
 #define M_SQRT2     1.41421356237309504880
 #define M_SQRT1_2   0.70710678118654752440
+
+/* GNU extensions, but GCC emits calls to them as an optimization. */
+void sincos(double, double *, double *);
+void sincosf(float, float *, float *);
+void sincosl(long double, long double *, long double *);
 
 #endif
Index: uspace/lib/c/test/stdio/scanf.c
===================================================================
--- uspace/lib/c/test/stdio/scanf.c	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/test/stdio/scanf.c	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -42,4 +42,6 @@
 #include <stdlib.h>
 
+#pragma GCC diagnostic ignored "-Wformat-zero-length"
+
 PCUT_INIT;
 
@@ -604,5 +606,5 @@
 
 	cp = NULL;
-	rc = sscanf("abc", "%m3c", &cp);
+	rc = sscanf("abc", "%3mc", &cp);
 	PCUT_ASSERT_INT_EQUALS(1, rc);
 	PCUT_ASSERT_NOT_NULL(cp);
Index: uspace/lib/c/test/string.c
===================================================================
--- uspace/lib/c/test/string.c	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/c/test/string.c	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -33,4 +33,7 @@
 #include <pcut/pcut.h>
 
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+
 PCUT_INIT;
 
@@ -544,5 +547,5 @@
 PCUT_TEST(strpbrk_empty_string)
 {
-	char *p;
+	const char *p;
 
 	p = strpbrk("", "abc");
@@ -553,5 +556,5 @@
 PCUT_TEST(strpbrk_empty_set)
 {
-	char *p;
+	const char *p;
 
 	p = strpbrk("abc", "");
Index: uspace/lib/math/generic/trig.c
===================================================================
--- uspace/lib/math/generic/trig.c	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/math/generic/trig.c	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -371,4 +371,30 @@
 }
 
+void sincosf(float x, float *s, float *c)
+{
+	float base_arg = fmodf(x, 2 * M_PI);
+
+	if (base_arg < 0) {
+		*s = -base_sin_32(-base_arg);
+		*c = base_cos_32(-base_arg);
+	} else {
+		*s = base_sin_32(base_arg);
+		*c = base_cos_32(base_arg);
+	}
+}
+
+void sincos(double x, double *s, double *c)
+{
+	double base_arg = fmod(x, 2 * M_PI);
+
+	if (base_arg < 0) {
+		*s = -base_sin_64(-base_arg);
+		*c = base_cos_64(-base_arg);
+	} else {
+		*s = base_sin_64(base_arg);
+		*c = base_cos_64(base_arg);
+	}
+}
+
 /** @}
  */
Index: uspace/lib/pcut/include/pcut/asserts.h
===================================================================
--- uspace/lib/pcut/include/pcut/asserts.h	(revision bbe5e34956da986df4d32357c697e539e8cfec0d)
+++ uspace/lib/pcut/include/pcut/asserts.h	(revision 58e7b26977afda549d7da683201907528ba22fd9)
@@ -148,5 +148,5 @@
 #define PCUT_ASSERT_NULL(pointer) \
 	do { \
-		void *pcut_ptr_eval = (pointer); \
+		const void *pcut_ptr_eval = (pointer); \
 		if (pcut_ptr_eval != (NULL)) { \
 			PCUT_ASSERTION_FAILED("Expected <" #pointer "> to be NULL, " \
