Index: uspace/lib/pcut/src/assert.c
===================================================================
--- uspace/lib/pcut/src/assert.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/assert.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -43,7 +43,11 @@
 
 #include "internal.h"
+
+#pragma warning(push, 0)
 #include <setjmp.h>
 #include <stdarg.h>
 #include <stdio.h>
+#pragma warning(pop)
+
 
 /** Maximum length of failed-assert message. */
@@ -59,6 +63,5 @@
 static int message_buffer_index = 0;
 
-void pcut_failed_assertion_fmt(const char *filename, int line, const char *fmt, ...)
-{
+void pcut_failed_assertion_fmt(const char *filename, int line, const char *fmt, ...) {
 	va_list args;
 	char *current_buffer = message_buffer[message_buffer_index];
@@ -66,5 +69,5 @@
 	message_buffer_index = (message_buffer_index + 1) % MESSAGE_BUFFER_COUNT;
 
-	snprintf(current_buffer, MAX_MESSAGE_LENGTH, "%s:%d: ", filename, line);
+	pcut_snprintf(current_buffer, MAX_MESSAGE_LENGTH, "%s:%d: ", filename, line);
 	offset = pcut_str_size(current_buffer);
 
Index: uspace/lib/pcut/src/helper.c
===================================================================
--- uspace/lib/pcut/src/helper.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
+++ uspace/lib/pcut/src/helper.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @file
+ *
+ * Helper functions.
+ */
+
+#include "internal.h"
+
+#pragma warning(push, 0)
+#include <stdarg.h>
+#include <stdio.h>
+#pragma warning(pop)
+
+/*
+ * It seems that not all Unixes are the same and snprintf
+ * may not be always exported?
+ */
+#ifdef __unix
+extern int snprintf(char *, size_t, const char *, ...);
+#endif
+
+
+int pcut_snprintf(char *dest, size_t size, const char *format, ...) {
+	va_list args;
+	int ret;
+
+	va_start(args, format);
+
+	/*
+	 * Use sprintf_s in Windows but only with Microsoft compiler.
+	 * Namely, let MinGW use snprintf.
+	 */
+#if (defined(__WIN64) || defined(__WIN32) || defined(_WIN32)) && defined(_MSC_VER)
+	ret = _vsnprintf_s(dest, size, _TRUNCATE, format, args);
+#else
+	ret = vsnprintf(dest, size, format, args);
+#endif
+
+	va_end(args);
+
+	return ret;
+}
Index: uspace/lib/pcut/src/internal.h
===================================================================
--- uspace/lib/pcut/src/internal.h	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/internal.h	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -35,5 +35,8 @@
 
 #include <pcut/pcut.h>
+
+#pragma warning(push, 0)
 #include <stdlib.h>
+#pragma warning(pop)
 
 
@@ -48,5 +51,7 @@
  */
 #ifdef PCUT_DEBUG_BUILD
+#pragma warning(push, 0)
 #include <stdio.h>
+#pragma warning(pop)
 #define PCUT_DEBUG_INTERNAL(msg, ...) \
 	fprintf(stderr, "[PCUT %s:%d]: " msg "%s", __FILE__, __LINE__, __VA_ARGS__)
@@ -78,12 +83,4 @@
  */
 #define PCUT_RUN_MODE_SINGLE 2
-
-/*
- * Use sprintf_s in Windows but only with Microsoft compiler.
- * Namely, let MinGW use snprintf.
- */
-#if (defined(__WIN64) || defined(__WIN32) || defined(_WIN32)) && defined(_MSC_VER)
-#define snprintf sprintf_s
-#endif
 
 extern int pcut_run_mode;
@@ -125,5 +122,5 @@
 	/** Test completed. */
 	void (*test_done)(pcut_item_t *, int, const char *, const char *,
-	    const char *);
+		const char *);
 };
 
@@ -135,8 +132,8 @@
 void pcut_report_test_start(pcut_item_t *test);
 void pcut_report_test_done(pcut_item_t *test, int outcome,
-    const char *error_message, const char *teardown_error_message,
-    const char *extra_output);
+		const char *error_message, const char *teardown_error_message,
+		const char *extra_output);
 void pcut_report_test_done_unparsed(pcut_item_t *test, int outcome,
-    const char *unparsed_output, size_t unparsed_output_size);
+		const char *unparsed_output, size_t unparsed_output_size);
 void pcut_report_done(void);
 
@@ -187,4 +184,8 @@
 char *pcut_str_find_char(const char *haystack, const char needle);
 
+/** Format string to a buffer.
+ *
+ */
+int pcut_snprintf(char *dest, size_t size, const char *format, ...);
 
 #endif
Index: uspace/lib/pcut/src/list.c
===================================================================
--- uspace/lib/pcut/src/list.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/list.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -32,6 +32,9 @@
  */
 
+#pragma warning(push, 0)
 #include <assert.h>
 #include <stdlib.h>
+#pragma warning(pop)
+
 #include "internal.h"
 #include <pcut/pcut.h>
@@ -43,6 +46,5 @@
  * @return First item with actual content or NULL on end of list.
  */
-pcut_item_t *pcut_get_real_next(pcut_item_t *item)
-{
+pcut_item_t *pcut_get_real_next(pcut_item_t *item) {
 	if (item == NULL) {
 		return NULL;
@@ -65,6 +67,5 @@
  * @return First item with actual content or NULL on end of list.
  */
-pcut_item_t *pcut_get_real(pcut_item_t *item)
-{
+pcut_item_t *pcut_get_real(pcut_item_t *item) {
 	if (item == NULL) {
 		return NULL;
@@ -83,6 +84,5 @@
  * @param nested Head of the nested list.
  */
-static void inline_nested_lists(pcut_item_t *nested)
-{
+static void inline_nested_lists(pcut_item_t *nested) {
 	pcut_item_t *first;
 
@@ -111,6 +111,5 @@
  * @param first List head.
  */
-static void set_ids(pcut_item_t *first)
-{
+static void set_ids(pcut_item_t *first) {
 	int id = 1;
 	pcut_item_t *it;
@@ -135,6 +134,5 @@
  * @param first Head of the list.
  */
-static void detect_skipped_tests(pcut_item_t *first)
-{
+static void detect_skipped_tests(pcut_item_t *first) {
 	pcut_item_t *it;
 
@@ -172,6 +170,5 @@
  * @return Head of the fixed list.
  */
-pcut_item_t *pcut_fix_list_get_real_head(pcut_item_t *last)
-{
+pcut_item_t *pcut_fix_list_get_real_head(pcut_item_t *last) {
 	pcut_item_t *next, *it;
 
@@ -201,6 +198,5 @@
  * @return Number of tests.
  */
-int pcut_count_tests(pcut_item_t *it)
-{
+int pcut_count_tests(pcut_item_t *it) {
 	int count = 0;
 	while (it != NULL) {
Index: uspace/lib/pcut/src/main.c
===================================================================
--- uspace/lib/pcut/src/main.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/main.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -34,7 +34,11 @@
 #include "internal.h"
 #include "report/report.h"
+
+#pragma warning(push, 0)
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
+#pragma warning(pop)
+
 
 /** Current running mode. */
@@ -57,8 +61,7 @@
  * @return Whether @p arg is @p opt followed by a number.
  */
-int pcut_is_arg_with_number(const char *arg, const char *opt, int *value)
-{
+int pcut_is_arg_with_number(const char *arg, const char *opt, int *value) {
 	int opt_len = pcut_str_size(opt);
-	if (!pcut_str_start_equals(arg, opt, opt_len)) {
+	if (! pcut_str_start_equals(arg, opt, opt_len)) {
 		return 0;
 	}
@@ -75,6 +78,5 @@
  * @retval NULL No item with such id exists in the list.
  */
-static pcut_item_t *pcut_find_by_id(pcut_item_t *first, int id)
-{
+static pcut_item_t *pcut_find_by_id(pcut_item_t *first, int id) {
 	pcut_item_t *it = pcut_get_real(first);
 	while (it != NULL) {
@@ -94,6 +96,5 @@
  * @return Error code.
  */
-static int run_suite(pcut_item_t *suite, pcut_item_t **last, const char *prog_path)
-{
+static int run_suite(pcut_item_t *suite, pcut_item_t **last, const char *prog_path) {
 	int is_first_test = 1;
 	int total_count = 0;
@@ -159,6 +160,5 @@
  * @param first First item of the list.
  */
-static void set_setup_teardown_callbacks(pcut_item_t *first)
-{
+static void set_setup_teardown_callbacks(pcut_item_t *first) {
 	pcut_item_t *active_suite = NULL;
 	pcut_item_t *it;
@@ -192,6 +192,5 @@
  * @return Program exit code.
  */
-int pcut_main(pcut_item_t *last, int argc, char *argv[])
-{
+int pcut_main(pcut_item_t *last, int argc, char *argv[]) {
 	pcut_item_t *items = pcut_fix_list_get_real_head(last);
 	pcut_item_t *it;
Index: uspace/lib/pcut/src/os/generic.c
===================================================================
--- uspace/lib/pcut/src/os/generic.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/os/generic.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -31,5 +31,5 @@
  * Platform-dependent test execution function when system() is available.
  */
-
+#pragma warning(push, 0)
 #include <stdlib.h>
 #include <stdio.h>
@@ -38,4 +38,6 @@
 #include <assert.h>
 #include <string.h>
+#pragma warning(pop)
+
 #include "../internal.h"
 
@@ -55,7 +57,7 @@
 
 #define FORMAT_COMMAND(buffer, buffer_size, self_path, test_id, temp_file) \
-	snprintf(buffer, buffer_size, "\"\"%s\" -t%d >%s\"", self_path, test_id, temp_file)
+	pcut_snprintf(buffer, buffer_size, "\"\"%s\" -t%d >%s\"", self_path, test_id, temp_file)
 #define FORMAT_TEMP_FILENAME(buffer, buffer_size) \
-	snprintf(buffer, buffer_size, "pcut_%d.tmp", _getpid())
+	pcut_snprintf(buffer, buffer_size, "pcut_%d.tmp", _getpid())
 
 #elif defined(__unix)
@@ -63,7 +65,7 @@
 
 #define FORMAT_COMMAND(buffer, buffer_size, self_path, test_id, temp_file) \
-	snprintf(buffer, buffer_size, "%s -t%d &>%s", self_path, test_id, temp_file)
+	pcut_snprintf(buffer, buffer_size, "%s -t%d &>%s", self_path, test_id, temp_file)
 #define FORMAT_TEMP_FILENAME(buffer, buffer_size) \
-	snprintf(buffer, buffer_size, "pcut_%d.tmp", getpid())
+	pcut_snprintf(buffer, buffer_size, "pcut_%d.tmp", getpid())
 
 #else
@@ -81,6 +83,5 @@
  * @param test Test that is about to start.
  */
-static void before_test_start(pcut_item_t *test)
-{
+static void before_test_start(pcut_item_t *test) {
 	pcut_report_test_start(test);
 
@@ -94,6 +95,5 @@
  * @return Test outcome code.
  */
-static int convert_wait_status_to_outcome(int status)
-{
+static int convert_wait_status_to_outcome(int status) {
 	if (status < 0) {
 		return PCUT_OUTCOME_INTERNAL_ERROR;
@@ -110,6 +110,5 @@
  * @param test Test to be run.
  */
-int pcut_run_test_forking(const char *self_path, pcut_item_t *test)
-{
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
 	int rc, outcome;
 	FILE *tempfile;
@@ -121,8 +120,8 @@
 	FORMAT_TEMP_FILENAME(tempfile_name, PCUT_TEMP_FILENAME_BUFFER_SIZE - 1);
 	FORMAT_COMMAND(command, PCUT_COMMAND_LINE_BUFFER_SIZE - 1,
-	    self_path, (test)->id, tempfile_name);
-
+		self_path, (test)->id, tempfile_name);
+	
 	PCUT_DEBUG("Will execute <%s> (temp file <%s>) with system().",
-	    command, tempfile_name);
+		command, tempfile_name);
 
 	rc = system(command);
@@ -147,6 +146,5 @@
 }
 
-void pcut_hook_before_test(pcut_item_t *test)
-{
+void pcut_hook_before_test(pcut_item_t *test) {
 	PCUT_UNUSED(test);
 
Index: uspace/lib/pcut/src/os/helenos.c
===================================================================
--- uspace/lib/pcut/src/os/helenos.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/os/helenos.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -46,33 +46,27 @@
 /* String functions. */
 
-int pcut_str_equals(const char *a, const char *b)
-{
+int pcut_str_equals(const char *a, const char *b) {
 	return str_cmp(a, b) == 0;
 }
 
 
-int pcut_str_start_equals(const char *a, const char *b, int len)
-{
+int pcut_str_start_equals(const char *a, const char *b, int len) {
 	return str_lcmp(a, b, len) == 0;
 }
 
-int pcut_str_size(const char *s)
-{
+int pcut_str_size(const char *s) {
 	return str_size(s);
 }
 
-int pcut_str_to_int(const char *s)
-{
+int pcut_str_to_int(const char *s) {
 	int result = strtol(s, NULL, 10);
 	return result;
 }
 
-char *pcut_str_find_char(const char *haystack, const char needle)
-{
+char *pcut_str_find_char(const char *haystack, const char needle) {
 	return str_chr(haystack, needle);
 }
 
-void pcut_str_error(errno_t error, char *buffer, int size)
-{
+void pcut_str_error(int error, char *buffer, int size) {
 	const char *str = str_error(error);
 	if (str == NULL) {
@@ -107,6 +101,5 @@
  * @param test Test that is about to be run.
  */
-static void before_test_start(pcut_item_t *test)
-{
+static void before_test_start(pcut_item_t *test) {
 	pcut_report_test_start(test);
 
@@ -116,10 +109,10 @@
 
 /** Mutex guard for forced_termination_cv. */
-static fibril_mutex_t forced_termination_mutex =
-    FIBRIL_MUTEX_INITIALIZER(forced_termination_mutex);
+static fibril_mutex_t forced_termination_mutex
+	= FIBRIL_MUTEX_INITIALIZER(forced_termination_mutex);
 
 /** Condition-variable for checking whether test timed-out. */
-static fibril_condvar_t forced_termination_cv =
-    FIBRIL_CONDVAR_INITIALIZER(forced_termination_cv);
+static fibril_condvar_t forced_termination_cv
+	= FIBRIL_CONDVAR_INITIALIZER(forced_termination_cv);
 
 /** Spawned task id. */
@@ -137,6 +130,5 @@
  * @return EOK Always.
  */
-static errno_t test_timeout_handler_fibril(void *arg)
-{
+static int test_timeout_handler_fibril(void *arg) {
 	pcut_item_t *test = arg;
 	int timeout_sec = pcut_get_test_timeout(test);
@@ -148,5 +140,5 @@
 	}
 	errno_t rc = fibril_condvar_wait_timeout(&forced_termination_cv,
-	    &forced_termination_mutex, timeout_us);
+		&forced_termination_mutex, timeout_us);
 	if (rc == ETIMEOUT) {
 		task_kill(test_task_id);
@@ -162,6 +154,5 @@
  * @param test Test to be run.
  */
-int pcut_run_test_forking(const char *self_path, pcut_item_t *test)
-{
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
 	before_test_start(test);
 
@@ -235,6 +226,5 @@
 }
 
-void pcut_hook_before_test(pcut_item_t *test)
-{
+void pcut_hook_before_test(pcut_item_t *test) {
 	PCUT_UNUSED(test);
 
Index: uspace/lib/pcut/src/os/stdc.c
===================================================================
--- uspace/lib/pcut/src/os/stdc.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/os/stdc.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -32,34 +32,31 @@
  */
 
+#pragma warning(push, 0)
 #include <string.h>
+#pragma warning(pop)
+
 #include "../internal.h"
 
-int pcut_str_equals(const char *a, const char *b)
-{
+int pcut_str_equals(const char *a, const char *b) {
 	return strcmp(a, b) == 0;
 }
 
-int pcut_str_start_equals(const char *a, const char *b, int len)
-{
+int pcut_str_start_equals(const char *a, const char *b, int len) {
 	return strncmp(a, b, len) == 0;
 }
 
-int pcut_str_size(const char *s)
-{
+int pcut_str_size(const char *s) {
 	return strlen(s);
 }
 
-int pcut_str_to_int(const char *s)
-{
+int pcut_str_to_int(const char *s) {
 	return atoi(s);
 }
 
-char *pcut_str_find_char(const char *haystack, const char needle)
-{
+char *pcut_str_find_char(const char *haystack, const char needle) {
 	return strchr(haystack, needle);
 }
 
-void pcut_str_error(int error, char *buffer, int size)
-{
+void pcut_str_error(int error, char *buffer, int size) {
 	const char *str = strerror(error);
 	if (str == NULL) {
Index: uspace/lib/pcut/src/os/unix.c
===================================================================
--- uspace/lib/pcut/src/os/unix.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/os/unix.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -64,6 +64,5 @@
  * @param test Test that is about to be run.
  */
-static void before_test_start(pcut_item_t *test)
-{
+static void before_test_start(pcut_item_t *test) {
 	pcut_report_test_start(test);
 
@@ -79,6 +78,5 @@
  * @param sig Signal number.
  */
-static void kill_child_on_alarm(int sig)
-{
+static void kill_child_on_alarm(int sig) {
 	PCUT_UNUSED(sig);
 	kill(child_pid, SIGKILL);
@@ -96,6 +94,5 @@
  * @return Number of actually read bytes.
  */
-static size_t read_all(int fd, char *buffer, size_t buffer_size)
-{
+static size_t read_all(int fd, char *buffer, size_t buffer_size) {
 	ssize_t actually_read;
 	char *buffer_start = buffer;
@@ -124,6 +121,5 @@
  * @return Test outcome code.
  */
-static int convert_wait_status_to_outcome(int status)
-{
+static int convert_wait_status_to_outcome(int status) {
 	if (WIFEXITED(status)) {
 		if (WEXITSTATUS(status) != 0) {
@@ -146,6 +142,5 @@
  * @param test Test to be run.
  */
-int pcut_run_test_forking(const char *self_path, pcut_item_t *test)
-{
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
 	int link_stdout[2], link_stderr[2];
 	int rc, status, outcome;
@@ -159,6 +154,6 @@
 	rc = pipe(link_stdout);
 	if (rc == -1) {
-		snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
-		    "pipe() failed: %s.", strerror(rc));
+		pcut_snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
+				"pipe() failed: %s.", strerror(rc));
 		pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, error_message_buffer, NULL, NULL);
 		return PCUT_OUTCOME_INTERNAL_ERROR;
@@ -166,6 +161,6 @@
 	rc = pipe(link_stderr);
 	if (rc == -1) {
-		snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
-		    "pipe() failed: %s.", strerror(rc));
+		pcut_snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
+				"pipe() failed: %s.", strerror(rc));
 		pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, error_message_buffer, NULL, NULL);
 		return PCUT_OUTCOME_INTERNAL_ERROR;
@@ -174,6 +169,6 @@
 	child_pid = fork();
 	if (child_pid == (pid_t)-1) {
-		snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
-		    "fork() failed: %s.", strerror(rc));
+		pcut_snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
+			"fork() failed: %s.", strerror(rc));
 		outcome = PCUT_OUTCOME_INTERNAL_ERROR;
 		goto leave_close_pipes;
@@ -220,6 +215,5 @@
 }
 
-void pcut_hook_before_test(pcut_item_t *test)
-{
+void pcut_hook_before_test(pcut_item_t *test) {
 	PCUT_UNUSED(test);
 
Index: uspace/lib/pcut/src/os/windows.c
===================================================================
--- uspace/lib/pcut/src/os/windows.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/os/windows.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -39,8 +39,11 @@
 #include "../internal.h"
 
+#pragma warning(push, 0)
 #include <windows.h>
 #include <tchar.h>
 #include <stdio.h>
 #include <strsafe.h>
+#pragma warning(pop)
+
 
 
@@ -61,6 +64,5 @@
  * @param test Test that is about to be run.
  */
-static void before_test_start(pcut_item_t *test)
-{
+static void before_test_start(pcut_item_t *test) {
 	pcut_report_test_start(test);
 
@@ -74,10 +76,9 @@
  * @param failed_function_name Name of the failed function.
  */
-static void report_func_fail(pcut_item_t *test, const char *failed_function_name)
-{
+static void report_func_fail(pcut_item_t *test, const char *failed_function_name) {
 	/* TODO: get error description. */
-	sprintf_s(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
-	    "%s failed: %s.", failed_function_name, "unknown reason");
-	pcut_report_test_done(test, TEST_OUTCOME_ERROR, error_message_buffer, NULL, NULL);
+	pcut_snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
+		"%s failed: %s.", failed_function_name, "unknown reason");
+	pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, error_message_buffer, NULL, NULL);
 }
 
@@ -93,6 +94,5 @@
  * @return Number of actually read bytes.
  */
-static size_t read_all(HANDLE fd, char *buffer, size_t buffer_size)
-{
+static size_t read_all(HANDLE fd, char *buffer, size_t buffer_size) {
 	DWORD actually_read;
 	char *buffer_start = buffer;
@@ -128,15 +128,14 @@
 };
 
-static DWORD WINAPI read_test_output_on_background(LPVOID test_output_data_ptr)
-{
+static DWORD WINAPI read_test_output_on_background(LPVOID test_output_data_ptr) {
 	size_t stderr_size = 0;
 	struct test_output_data *test_output_data = (struct test_output_data *) test_output_data_ptr;
 
 	stderr_size = read_all(test_output_data->pipe_stderr,
-	    test_output_data->output_buffer,
-	    test_output_data->output_buffer_size - 1);
+		test_output_data->output_buffer,
+		test_output_data->output_buffer_size - 1);
 	read_all(test_output_data->pipe_stdout,
-	    test_output_data->output_buffer,
-	    test_output_data->output_buffer_size - 1 - stderr_size);
+		test_output_data->output_buffer,
+		test_output_data->output_buffer_size - 1 - stderr_size);
 
 	return 0;
@@ -148,6 +147,5 @@
  * @param test Test to be run.
  */
-int pcut_run_test_forking(const char *self_path, pcut_item_t *test)
-{
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
 	/* TODO: clean-up if something goes wrong "in the middle" */
 	BOOL okay = FALSE;
@@ -220,10 +218,10 @@
 
 	/* Format the command line. */
-	sprintf_s(command, PCUT_COMMAND_LINE_BUFFER_SIZE - 1,
-	    "\"%s\" -t%d", self_path, test->id);
+	pcut_snprintf(command, PCUT_COMMAND_LINE_BUFFER_SIZE - 1,
+		"\"%s\" -t%d", self_path, test->id);
 
 	/* Run the process. */
 	okay = CreateProcess(NULL, command, NULL, NULL, TRUE, 0, NULL, NULL,
-	    &start_info, &process_info);
+		&start_info, &process_info);
 
 	if (!okay) {
@@ -267,6 +265,6 @@
 
 	test_output_thread_reader = CreateThread(NULL, 0,
-	    read_test_output_on_background, &test_output_data,
-	    0, NULL);
+		read_test_output_on_background, &test_output_data,
+		0, NULL);
 
 	if (test_output_thread_reader == NULL) {
@@ -286,5 +284,5 @@
 		if (!okay) {
 			report_func_fail(test, "TerminateProcess(/* PROCESS_INFORMATION.hProcess */)");
-			return PCUT_ERROR_INTERNAL_FAILURE;
+			return PCUT_OUTCOME_INTERNAL_ERROR;
 		}
 		rc = WaitForSingleObject(process_info.hProcess, INFINITE);
@@ -314,5 +312,5 @@
 	if (rc != WAIT_OBJECT_0) {
 		report_func_fail(test, "WaitForSingleObject(/* stdout reader thread */)");
-		return PCUT_ERROR_INTERNAL_FAILURE;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -322,6 +320,5 @@
 }
 
-void pcut_hook_before_test(pcut_item_t *test)
-{
+void pcut_hook_before_test(pcut_item_t *test) {
 	PCUT_UNUSED(test);
 
Index: uspace/lib/pcut/src/preproc.c
===================================================================
--- uspace/lib/pcut/src/preproc.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/preproc.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -27,9 +27,11 @@
  */
 
-#include <stdbool.h>
+#pragma warning(push, 0)
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
+#pragma warning(pop)
+
 
 #define MAX_IDENTIFIER_LENGTH 256
@@ -37,16 +39,13 @@
 static int counter = 0;
 
-static void print_numbered_identifier(int value, FILE *output)
-{
+static void print_numbered_identifier(int value, FILE *output) {
 	fprintf(output, "pcut_item_%d", value);
 }
 
-static void print_numbered_identifier2(int value, FILE *output)
-{
+static void print_numbered_identifier2(int value, FILE *output) {
 	fprintf(output, "pcut_item2_%d", value);
 }
 
-static void print_numbered_identifier3(int value, FILE *output)
-{
+static void print_numbered_identifier3(int value, FILE *output) {
 	fprintf(output, "pcut_item3_%d", value);
 }
@@ -57,12 +56,10 @@
 } identifier_t;
 
-static void identifier_init(identifier_t *identifier)
-{
+static void identifier_init(identifier_t *identifier) {
 	identifier->name[0] = 0;
 	identifier->length = 0;
 }
 
-static void identifier_add_char(identifier_t *identifier, char c)
-{
+static void identifier_add_char(identifier_t *identifier, char c) {
 	if (identifier->length + 1 >= MAX_IDENTIFIER_LENGTH) {
 		fprintf(stderr, "Identifier %s is too long, aborting!\n", identifier->name);
@@ -75,6 +72,5 @@
 }
 
-static void identifier_print_or_expand(identifier_t *identifier, FILE *output)
-{
+static void identifier_print_or_expand(identifier_t *identifier, FILE *output) {
 	const char *name = identifier->name;
 	if (strcmp(name, "PCUT_ITEM_NAME") == 0) {
@@ -93,11 +89,10 @@
 }
 
-static int is_identifier_char(int c, int inside_identifier)
-{
-	return isalpha(c) || (c == '_') || (inside_identifier && isdigit(c));
+static int is_identifier_char(int c, int inside_identifier) {
+	return isalpha(c) || (c == '_')
+			|| (inside_identifier && isdigit(c));
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
 	FILE *input = stdin;
 	FILE *output = stdout;
@@ -110,5 +105,5 @@
 	(void) argv;
 
-	while (true) {
+	while (1) {
 		int current_char_denotes_identifier;
 
Index: uspace/lib/pcut/src/print.c
===================================================================
--- uspace/lib/pcut/src/print.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/print.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -33,7 +33,11 @@
 
 #include <pcut/pcut.h>
+
+#pragma warning(push, 0)
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
+#pragma warning(pop)
+
 #include "internal.h"
 
@@ -42,6 +46,5 @@
  * @param first First item to be printed.
  */
-void pcut_print_items(pcut_item_t *first)
-{
+void pcut_print_items(pcut_item_t *first) {
 	pcut_item_t *it = first;
 	printf("====>\n");
@@ -72,6 +75,5 @@
  * @param first First item to be printed.
  */
-void pcut_print_tests(pcut_item_t *first)
-{
+void pcut_print_tests(pcut_item_t *first) {
 	pcut_item_t *it;
 	for (it = pcut_get_real(first); it != NULL; it = pcut_get_real_next(it)) {
Index: uspace/lib/pcut/src/report/report.c
===================================================================
--- uspace/lib/pcut/src/report/report.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/report/report.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -33,11 +33,17 @@
 
 #include "../internal.h"
+
 #ifdef __helenos__
-#include <str.h>
+#include <mem.h>
 #else
+#pragma warning(push, 0)
 #include <string.h>
+#pragma warning(pop)
 #endif
-#include <stdbool.h>
+
+#pragma warning(push, 0)
 #include <stdio.h>
+#pragma warning(pop)
+
 
 /** Currently used report ops. */
@@ -68,6 +74,5 @@
  * @param msg The message to be printed.
  */
-void pcut_print_fail_message(const char *msg)
-{
+void pcut_print_fail_message(const char *msg) {
 	if (msg == NULL) {
 		return;
@@ -99,7 +104,6 @@
  */
 static void parse_command_output(const char *full_output, size_t full_output_size,
-    char *stdio_buffer, size_t stdio_buffer_size,
-    char *error_buffer, size_t error_buffer_size)
-{
+		char *stdio_buffer, size_t stdio_buffer_size,
+		char *error_buffer, size_t error_buffer_size) {
 	memset(stdio_buffer, 0, stdio_buffer_size);
 	memset(error_buffer, 0, error_buffer_size);
@@ -111,5 +115,5 @@
 	}
 
-	while (true) {
+	while (1) {
 		size_t message_length;
 
@@ -157,6 +161,5 @@
  * @param ops Functions to use.
  */
-void pcut_report_register_handler(pcut_report_ops_t *ops)
-{
+void pcut_report_register_handler(pcut_report_ops_t *ops) {
 	report_ops = ops;
 }
@@ -166,6 +169,5 @@
  * @param all_items List of all tests that could be run.
  */
-void pcut_report_init(pcut_item_t *all_items)
-{
+void pcut_report_init(pcut_item_t *all_items) {
 	REPORT_CALL(init, all_items);
 }
@@ -175,6 +177,5 @@
  * @param suite Suite that was just started.
  */
-void pcut_report_suite_start(pcut_item_t *suite)
-{
+void pcut_report_suite_start(pcut_item_t *suite) {
 	REPORT_CALL(suite_start, suite);
 }
@@ -184,6 +185,5 @@
  * @param suite Suite that just completed.
  */
-void pcut_report_suite_done(pcut_item_t *suite)
-{
+void pcut_report_suite_done(pcut_item_t *suite) {
 	REPORT_CALL(suite_done, suite);
 }
@@ -193,6 +193,5 @@
  * @param test Test to be run just about now.
  */
-void pcut_report_test_start(pcut_item_t *test)
-{
+void pcut_report_test_start(pcut_item_t *test) {
 	REPORT_CALL(test_start, test);
 }
@@ -207,9 +206,8 @@
  */
 void pcut_report_test_done(pcut_item_t *test, int outcome,
-    const char *error_message, const char *teardown_error_message,
-    const char *extra_output)
-{
+		const char *error_message, const char *teardown_error_message,
+		const char *extra_output) {
 	REPORT_CALL(test_done, test, outcome, error_message, teardown_error_message,
-	    extra_output);
+			extra_output);
 }
 
@@ -222,10 +220,9 @@
  */
 void pcut_report_test_done_unparsed(pcut_item_t *test, int outcome,
-    const char *unparsed_output, size_t unparsed_output_size)
-{
+		const char *unparsed_output, size_t unparsed_output_size) {
 
 	parse_command_output(unparsed_output, unparsed_output_size,
-	    buffer_for_extra_output, BUFFER_SIZE,
-	    buffer_for_error_messages, BUFFER_SIZE);
+			buffer_for_extra_output, BUFFER_SIZE,
+			buffer_for_error_messages, BUFFER_SIZE);
 
 	pcut_report_test_done(test, outcome, buffer_for_error_messages, NULL, buffer_for_extra_output);
@@ -235,6 +232,5 @@
  *
  */
-void pcut_report_done(void)
-{
+void pcut_report_done(void) {
 	REPORT_CALL_NO_ARGS(done);
 }
Index: uspace/lib/pcut/src/report/tap.c
===================================================================
--- uspace/lib/pcut/src/report/tap.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/report/tap.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -34,8 +34,15 @@
 #include "../internal.h"
 #include "report.h"
+
 #ifndef __helenos__
+#pragma warning(push, 0)
 #include <string.h>
+#pragma warning(pop)
 #endif
+
+#pragma warning(push, 0)
 #include <stdio.h>
+#pragma warning(pop)
+
 
 /** Counter of all run tests. */
@@ -55,6 +62,5 @@
  * @param all_items Start of the list with all items.
  */
-static void tap_init(pcut_item_t *all_items)
-{
+static void tap_init(pcut_item_t *all_items) {
 	int tests_total = pcut_count_tests(all_items);
 	test_counter = 0;
@@ -68,6 +74,5 @@
  * @param suite Suite that just started.
  */
-static void tap_suite_start(pcut_item_t *suite)
-{
+static void tap_suite_start(pcut_item_t *suite) {
 	tests_in_suite = 0;
 	failed_tests_in_suite = 0;
@@ -80,12 +85,11 @@
  * @param suite Suite that just ended.
  */
-static void tap_suite_done(pcut_item_t *suite)
-{
+static void tap_suite_done(pcut_item_t *suite) {
 	if (failed_tests_in_suite == 0) {
 		printf("#> Finished suite %s (passed).\n",
-		    suite->name);
+				suite->name);
 	} else {
 		printf("#> Finished suite %s (failed %d of %d).\n",
-		    suite->name, failed_tests_in_suite, tests_in_suite);
+				suite->name, failed_tests_in_suite, tests_in_suite);
 	}
 }
@@ -97,6 +101,5 @@
  * @param test Test that is started.
  */
-static void tap_test_start(pcut_item_t *test)
-{
+static void tap_test_start(pcut_item_t *test) {
 	PCUT_UNUSED(test);
 
@@ -110,6 +113,5 @@
  * @param prefix Prefix for each new line, such as comment character.
  */
-static void print_by_lines(const char *message, const char *prefix)
-{
+static void print_by_lines(const char *message, const char *prefix) {
 	char *next_line_start;
 	if ((message == NULL) || (message[0] == 0)) {
@@ -137,7 +139,6 @@
  */
 static void tap_test_done(pcut_item_t *test, int outcome,
-    const char *error_message, const char *teardown_error_message,
-    const char *extra_output)
-{
+		const char *error_message, const char *teardown_error_message,
+		const char *extra_output) {
 	const char *test_name = test->name;
 	const char *status_str = NULL;
@@ -172,6 +173,5 @@
 
 /** Report testing done. */
-static void tap_done(void)
-{
+static void tap_done(void) {
 	if (failed_test_counter == 0) {
 		printf("#> Done: all tests passed.\n");
Index: uspace/lib/pcut/src/report/xml.c
===================================================================
--- uspace/lib/pcut/src/report/xml.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/report/xml.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -34,8 +34,15 @@
 #include "../internal.h"
 #include "report.h"
+
 #ifndef __helenos__
+#pragma warning(push, 0)
 #include <string.h>
+#pragma warning(pop)
 #endif
+
+#pragma warning(push, 0)
 #include <stdio.h>
+#pragma warning(pop)
+
 
 /** Counter of all run tests. */
@@ -52,6 +59,5 @@
  * @param all_items Start of the list with all items.
  */
-static void xml_init(pcut_item_t *all_items)
-{
+static void xml_init(pcut_item_t *all_items) {
 	int tests_total = pcut_count_tests(all_items);
 	test_counter = 0;
@@ -65,6 +71,5 @@
  * @param suite Suite that just started.
  */
-static void xml_suite_start(pcut_item_t *suite)
-{
+static void xml_suite_start(pcut_item_t *suite) {
 	tests_in_suite = 0;
 	failed_tests_in_suite = 0;
@@ -77,8 +82,7 @@
  * @param suite Suite that just ended.
  */
-static void xml_suite_done(pcut_item_t *suite)
-{
+static void xml_suite_done(pcut_item_t *suite) {
 	printf("\t</suite><!-- %s: %d / %d -->\n", suite->name,
-	    failed_tests_in_suite, tests_in_suite);
+		failed_tests_in_suite, tests_in_suite);
 }
 
@@ -89,6 +93,5 @@
  * @param test Test that is started.
  */
-static void xml_test_start(pcut_item_t *test)
-{
+static void xml_test_start(pcut_item_t *test) {
 	PCUT_UNUSED(test);
 
@@ -102,6 +105,5 @@
  * @param element_name Wrapping XML element name.
  */
-static void print_by_lines(const char *message, const char *element_name)
-{
+static void print_by_lines(const char *message, const char *element_name) {
 	char *next_line_start;
 
@@ -135,7 +137,6 @@
  */
 static void xml_test_done(pcut_item_t *test, int outcome,
-    const char *error_message, const char *teardown_error_message,
-    const char *extra_output)
-{
+		const char *error_message, const char *teardown_error_message,
+		const char *extra_output) {
 	const char *test_name = test->name;
 	const char *status_str = NULL;
@@ -158,5 +159,5 @@
 
 	printf("\t\t<testcase name=\"%s\" status=\"%s\">\n", test_name,
-	    status_str);
+		status_str);
 
 	print_by_lines(error_message, "error-message");
@@ -169,6 +170,5 @@
 
 /** Report testing done. */
-static void xml_done(void)
-{
+static void xml_done(void) {
 	printf("</report>\n");
 }
Index: uspace/lib/pcut/src/run.c
===================================================================
--- uspace/lib/pcut/src/run.c	(revision bd41ac52cf7d20e9e568c519bf2cb5ac7104b86a)
+++ uspace/lib/pcut/src/run.c	(revision 60c96cfcb323fce6cc56b8d9a9a9c5ea68bda15f)
@@ -33,6 +33,9 @@
 
 #include "internal.h"
+
 #ifndef PCUT_NO_LONG_JUMP
+#pragma warning(push, 0)
 #include <setjmp.h>
+#pragma warning(pop)
 #endif
 
@@ -73,6 +76,5 @@
 static int default_suite_initialized = 0;
 
-static void init_default_suite_when_needed()
-{
+static void init_default_suite_when_needed() {
 	if (default_suite_initialized) {
 		return;
@@ -92,6 +94,5 @@
  * @return Always a valid test suite item.
  */
-static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it)
-{
+static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) {
 	while (it != NULL) {
 		if (it->kind == PCUT_KIND_TESTSUITE) {
@@ -108,6 +109,5 @@
  * @param func Function to run (can be NULL).
  */
-static void run_setup_teardown(pcut_setup_func_t func)
-{
+static void run_setup_teardown(pcut_setup_func_t func) {
 	if (func != NULL) {
 		func();
@@ -122,8 +122,7 @@
  * @param outcome Outcome of the current test.
  */
-static void leave_test(int outcome)
-{
+static void leave_test(int outcome) {
 	PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome,
-	    leave_means_exit ? "yes" : "no");
+		leave_means_exit ? "yes" : "no");
 	if (leave_means_exit) {
 		exit(outcome);
@@ -142,6 +141,5 @@
  * @param message Message describing the failure.
  */
-void pcut_failed_assertion(const char *message)
-{
+void pcut_failed_assertion(const char *message) {
 	static const char *prev_message = NULL;
 	/*
@@ -162,10 +160,10 @@
 		if (report_test_result) {
 			pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL,
-			    message, NULL, NULL);
+				message, NULL, NULL);
 		}
 	} else {
 		if (report_test_result) {
 			pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL,
-			    prev_message, message, NULL);
+				prev_message, message, NULL);
 		}
 	}
@@ -181,6 +179,5 @@
  * @return Error status (zero means success).
  */
-static int run_test(pcut_item_t *test)
-{
+static int run_test(pcut_item_t *test) {
 	/*
 	 * Set here as the returning point in case of test failure.
@@ -234,5 +231,5 @@
 	if (report_test_result) {
 		pcut_report_test_done(current_test, PCUT_OUTCOME_PASS,
-		    NULL, NULL, NULL);
+			NULL, NULL, NULL);
 	}
 
@@ -248,6 +245,5 @@
  * @return Error status (zero means success).
  */
-int pcut_run_test_forked(pcut_item_t *test)
-{
+int pcut_run_test_forked(pcut_item_t *test) {
 	int rc;
 
@@ -272,6 +268,5 @@
  * @return Error status (zero means success).
  */
-int pcut_run_test_single(pcut_item_t *test)
-{
+int pcut_run_test_single(pcut_item_t *test) {
 	int rc;
 
@@ -293,6 +288,5 @@
  * @return Timeout in seconds.
  */
-int pcut_get_test_timeout(pcut_item_t *test)
-{
+int pcut_get_test_timeout(pcut_item_t *test) {
 	int timeout = PCUT_DEFAULT_TEST_TIMEOUT;
 	pcut_extra_t *extras = test->extras;
