From 38e5485c6a8ece99aa8aac2f318f14764857ee24 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 2 Mar 2015 20:27:50 -0600 Subject: On 64 bit, subtracting two pointers produces a long result. On 32 bit, it's an int. Even though long _is_ 32 bits on a 32 bit systems, gcc warns about it because reasons. Also, the warning being that "expects int, but type is wchar_t"... no, type is not wchar_t. Type is probably long. Specify the ACTUAL TYPE, not the random typedef alias for it. If the translated type _did_ match, there wouldn't be a warning! (This is why c89 promoted all arguments to int, precisely so this wasn't a problem.) --- toys/posix/sed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix/sed.c') diff --git a/toys/posix/sed.c b/toys/posix/sed.c index 628953c5..dc3c8d91 100644 --- a/toys/posix/sed.c +++ b/toys/posix/sed.c @@ -997,7 +997,7 @@ resume_a: brand: // Reminisce about chestnut trees. - error_exit("bad pattern '%s'@%ld (%c)", errstart, line-errstart+1, *line); + error_exit("bad pattern '%s'@%ld (%c)", errstart, line-errstart+1L, *line); } void sed_main(void) -- cgit v1.2.3