public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* -Wsign-conversion flag in gcc in cygwin.
@ 2022-01-13 14:33 Amit
  2022-01-13 20:24 ` Csaba Raduly
  0 siblings, 1 reply; 2+ messages in thread
From: Amit @ 2022-01-13 14:33 UTC (permalink / raw)
  To: cygwin

Hi,

When I compile "long x = strlen("abcde")" on a linux system with the
following gcc flags -Wall -Wconversion, I get the following warning:

==============================
size.c: In function ‘main’:
size.c:7:17: warning: conversion to ‘long int’ from ‘size_t’ may
change the sign of the result [-Wsign-conversion]
  long x = strlen("abcde");
                 ^
==============================

But on cygwin, I don't get this warning.

So, is -Wsign-conversion flag not implemented in gcc in cygwin?

--------------------------------------------------------------
$ gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -dumpmachine
x86_64-pc-cygwin
--------------------------------------------------------------

Amit

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

end of thread, other threads:[~2022-01-13 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 14:33 -Wsign-conversion flag in gcc in cygwin Amit
2022-01-13 20:24 ` Csaba Raduly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).