]> granicus.if.org Git - check/commit
fix ck_assert_ptr_* causing const compilation warnings
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sat, 7 Dec 2013 05:05:15 +0000 (05:05 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sat, 7 Dec 2013 05:05:15 +0000 (05:05 +0000)
commite93752dacf7e5406712a64606d0e53489270450f
tree31b5e348baedc9b5cbe539920795534250779984
parent0cfdab5bff6b1e1bbbc54b531b168f3cb1ca04f5
fix ck_assert_ptr_* causing const compilation warnings

A test sequence such as:

const struct my_vtable expected_element;
struct my_vtable* test_element;
ck_assert_ptr_eq(test_element, &expected_element);

Compiled using gcc 4.7.2 with -Wall gives the following warning.
myfile.c:70:2: warning: initialization discards â€˜const’ qualifier from pointer target type [enabled by default]

Adding a const qualifier to the variables in the _ck_assert_ptr macro,
as done for _ck_assert_str makes the problem go away.

Issue #91, patch submitted by user lordlod24.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@861 64e312b2-a51f-0410-8e61-82d0ca0eb02a
AUTHORS
NEWS
src/check.h.in