public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Amit <amitchoudhary0523@gmail.com>
To: cygwin@cygwin.com
Subject: -Wsign-conversion flag in gcc in cygwin.
Date: Thu, 13 Jan 2022 20:03:52 +0530	[thread overview]
Message-ID: <CAFf+5ziAh0X9cujnRMiSS0bcZWoZX7wi4aaAb2n1k0rLDf=3xQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2022-01-13 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 14:33 Amit [this message]
2022-01-13 20:24 ` Csaba Raduly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFf+5ziAh0X9cujnRMiSS0bcZWoZX7wi4aaAb2n1k0rLDf=3xQ@mail.gmail.com' \
    --to=amitchoudhary0523@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).