Git development
 help / color / mirror / Atom feed
* unary minus operator applied to unsigned type, result still unsigned?
@ 2016-05-04 22:59 Philip Oakley
  2016-05-04 23:19 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Oakley @ 2016-05-04 22:59 UTC (permalink / raw)
  To: Git List

I'm working on building Git on Visual Studio as part of the Git for Windows
capability.

The MSVC compiler is reporting:

1>..\sha1-lookup.c(100) : warning C4146: unary minus operator applied to
unsigned type, result still unsigned

1>..\sha1-lookup.c(316) : warning C4146: unary minus operator applied to
unsigned type, result still unsigned

the two lines of code are the same, and the message suggests a bad return 
value:

#100: return -lo-1;

#316: return -lo-1;


Should these be protected by an appropriate brackets/calculation (-1-lo) ? 
Or does
gcc use an alternate assumption about unary minus conversion for functions
returning int?

--

Philip

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-05 21:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 22:59 unary minus operator applied to unsigned type, result still unsigned? Philip Oakley
2016-05-04 23:19 ` Junio C Hamano
2016-05-05 21:39   ` Philip Oakley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox