Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3681468
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:41:31+00:00 2026-05-19T03:41:31+00:00

Along the same lines as to what was described in conversion to ‘size_t’ from

  • 0

Along the same lines as to what was described in conversion to ‘size_t’ from ‘int’ may change the sign of the result – GCC , C, I would instead like to insure that the warning I receive under GCC 4.2.1 is also flagged under VS2008 SP1 under both 32-bit and 64-bit compilation, versus disabling warnings under GCC to suit VS2008.

For example, under GCC 4.2.1 under 64-bit conditions, we see the following as a warning under -Wall conditions:

#include <string.h>
bool foo()
{
    size_t len = 0;
    const char * someBuffer = "flubber";
    len = strlen(someBuffer);
    bool retval = false;
    for (int j = 0; j < len; j++) // <-- warning
    {
        if (someBuffer[j] != '0')
        {
            retval = true;
            break;
        }
    }
    return retval;
}

The GCC warning is:

warning: comparison between signed and unsigned integer expressions

But it is not flagged by the VS2008 SP1 64-bit compiler, no matter what types of pragmas I try and no matter what I enable using /W3 or /W4, or /w3some_warning_number or /w4some_warning_number, etc.

Now, I don’t want to dumb down GCC’s warning levels or disable the warning, since they had the warning in there for very good reasons. So I would like the VS builds to fail in similar ways when /WX is enabled. Is this something I have to live with, or is there some warning that would do the trick on VS2008?

EDIT: The warning shows up for 32-bit builds but not using 64-bit builds, using the same set of compiler options, shown below:

/O2
/Ob2
/D "WIN32"
/D "_WINDOWS"
/D "NDEBUG"
/D "_CRT_SECURE_NO_WARNINGS"
/D "__WIN32__"
/D "_SCL_SECURE_NO_WARNINGS"
/D "_BIND_TO_CURRENT_MFC_VERSION"
/D "_BIND_TO_CURRENT_CRT_VERSION"
/D "WINVER=0x0502"
/D "_WIN32_WINNT=0x0502"
/D "_WIN32"
/D "_NT"
/D "_CRT_NONSTDC_NO_WARNINGS"
/D "_MBCS"
/FD
/EHsc
/MD
/W3
/WX
/TP
/Zm1000

EDIT #1: Seeing as this might be a Visual Studio idiosyncrasy, I posted to Visual C++ Developer Center – warning C4018: ‘<‘ : signed/unsigned mismatch is emitted for 32-bit but not 64-bit compilation under VS2008 SP1 on 64-bit Windows.

EDIT #2: I was directed to post to Microsoft Connect from within the Visual C++ Developer Center posting, and today (2011-01-11) Microsoft replied to my question and verified it as a compiler issue: They stated that the issue will added to the backlog to be fixed in a future release: Microsoft Connect – warning C4018: ‘<‘ : signed/unsigned mismatch is only emitted between like-sized types.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:41:32+00:00Added an answer on May 19, 2026 at 3:41 am

    Answering my own question: See my EDIT #2 in the original question area. It is now recognized by Microsoft as a compiler issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Along the lines of my previous question , how can i join a list
I am thinking along the lines of replicating a web hosts PHP setup environment
I was thinking along the lines of using typeid() but I don't know how
I have an ASP.NET webservice with along the lines of: [WebService(Namespace = http://internalservice.net/messageprocessing)] [WebServiceBinding(ConformsTo
Somewhere along the line I picked up the notion that using iframes is 'bad
I was following along with the railscast regarding the restful_authentication plugin. He recommended running
I use MyGeneration along with nHibernate to create the basic POCO objects and XML
So I'm programming along in a nice, up to date, object oriented fashion. I
I'm following along with this useful looking answer to my question . It seems
I had been happily coding along on a decent sized solution (just over 13k

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.