X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DDFD53951C14
Authentication-Results: sourceware.org;
 dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:from:date:message-id:subject:to
 :content-transfer-encoding;
 bh=WKOc77hwiqPCnWod7OaMV09l3Sj41RJXkpPYEPCx6ks=;
 b=KBYDVXqVGDfiT65tJegD3KPKGnzTdbhvSYn2tIkrtQvTNuO1XqH46HoSPW+msHBeg4
 qxe7xQHCAmdc25qEyWFNjoRDDHT0lecaG/yAehk77fGLS38A6IkyqdaXT5bj4geBiYel
 SqZnEmCxXXpGqHq2j/JOZfqj40MGdImfnnz26y9VqZpKgJZxkjThGfY/CN6mtfqlbEL1
 uXJ9JYJ+TUyc2LC68tEB3wxtCl/Gt2Qv10lL4YkhDCxIWVNcgwKsV8f2i5ZvwCKwJLLq
 iO35DD6CsoanPpY3YpjMoDlaADaQB/hnxZ5MtHio8HfeDcXUfBcoDP/gKme/MgZijMDd
 hZUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to
 :content-transfer-encoding;
 bh=WKOc77hwiqPCnWod7OaMV09l3Sj41RJXkpPYEPCx6ks=;
 b=Vxn22IBd5mXm/qWOpvUr+fTjmUbqQ17yVunQGcUOv0CxbKOcG2w5edeGXp6e8v9smR
 HuEb3t/ZTQfJ9KON7vGz0WwjHc2guWxMNcjdWWvJPh8MHRMeAWG+vOYWjz1tSgPIz5GK
 1JLT4Kbv0NKzK/283pe58sOXMmHLchKiNi3ZA6dgJCb72j0RmAnBerVixq8sTjmx21gf
 7Ruxm5VVtP6SufEMEFIQbHeeMUuUJM3Vo+MYPNH3I7y9kbH1spIuKkcQoIZFK44WmUFH
 /AvH9csz/CxkNNWmb8HZ0YUGd0AwziIwlnkCTejjBYiqZ+vrsx3YxG6U0KL3LA6qRQLc
 ZEaA==
X-Gm-Message-State: AOAM531eQC75mpitXTKljciA8kp6FxRl6hWDAMyuVi/0k1t5b7kcRW0Z
 CDMrIwKSolVE/y0edEEs7RNBHyeAL0DVlUbbN48kv/jSePg=
X-Google-Smtp-Source: ABdhPJw3CwPwy3NPWZhAjosTLoryL8hL2KjPFKF+d3xP8jGLrXxM05CGA6x4a4WhgcYT5p8zl5D/6WnVQo6KhhDtrAg=
X-Received: by 2002:a05:6512:1684:: with SMTP id
 bu4mr3486358lfb.293.1642084443322; 
 Thu, 13 Jan 2022 06:34:03 -0800 (PST)
MIME-Version: 1.0
From: Amit <amitchoudhary0523@gmail.com>
Date: Thu, 13 Jan 2022 20:03:52 +0530
Message-ID: <CAFf+5ziAh0X9cujnRMiSS0bcZWoZX7wi4aaAb2n1k0rLDf=3xQ@mail.gmail.com>
Subject: -Wsign-conversion flag in gcc in cygwin.
To: cygwin@cygwin.com
X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT,
 FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 20DEYx1U013218

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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

