aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-26 09:50:32 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-06 17:43:37 +0200
commite3a5d3631fc2ba949fa5ba3c6d7b02387da2cf32 (patch)
tree60494207306006384702f5ecc69d7ceedf662949 /validation
parentdb491ea79222ddaecc1d3c976bf76dc84e169405 (diff)
downloadsparse-dev-e3a5d3631fc2ba949fa5ba3c6d7b02387da2cf32.tar.gz
cast: fix warning position in cast_pseudo()
The function cast_pseudo() can issues warnings about non size-preserving integer <-> pointer casts. The file:line:column position of these warnings is taken from the destination type but this position is the one where the type is declared (or where the symbol associated with this type is defined) which may or may not be related to the position of the cast. Fix this by using the current position instead (which should hold the position of the cast). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/cast-kinds-check.c4
-rw-r--r--validation/cast-weirds.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/validation/cast-kinds-check.c b/validation/cast-kinds-check.c
index b50ddd24..7eb1ca1c 100644
--- a/validation/cast-kinds-check.c
+++ b/validation/cast-kinds-check.c
@@ -13,7 +13,7 @@ optim/cast-kinds.c:12:48: warning: cast drops bits
optim/cast-kinds.c:13:50: warning: cast drops bits
optim/cast-kinds.c:14:49: warning: cast drops bits
optim/cast-kinds.c:15:48: warning: cast drops bits
-optim/cast-kinds.c:37:42: warning: non size-preserving integer to pointer cast
-optim/cast-kinds.c:38:44: warning: non size-preserving integer to pointer cast
+optim/cast-kinds.c:37:48: warning: non size-preserving integer to pointer cast
+optim/cast-kinds.c:38:50: warning: non size-preserving integer to pointer cast
* check-error-end
*/
diff --git a/validation/cast-weirds.c b/validation/cast-weirds.c
index 01ccc473..7d028882 100644
--- a/validation/cast-weirds.c
+++ b/validation/cast-weirds.c
@@ -12,7 +12,7 @@ static void * uint_2_vptr(uint a) { return (void *)a; }
* check-command: sparse -m64 $file
*
* check-error-start
-cast-weirds.c:4:42: warning: non size-preserving integer to pointer cast
-cast-weirds.c:5:44: warning: non size-preserving integer to pointer cast
+cast-weirds.c:4:48: warning: non size-preserving integer to pointer cast
+cast-weirds.c:5:50: warning: non size-preserving integer to pointer cast
* check-error-end
*/