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 6092961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:30:19+00:00 2026-05-23T12:30:19+00:00

I am hoping to enable warnings for the following C++ compilation issues and corresponding

  • 0

I am hoping to enable warnings for the following C++ compilation issues and corresponding compilers:

  1. Unused variables — Sun Studio CC

    Example: void m() { int i = 10; }

  2. Signed to unsigned comparison – VC++ and Sun Studio CC

    Example: if ((unsigned) 10 < -1);

  3. Wrong field initialization order – VC++ and Sun Studio CC

    Example: class A { int i, j; A() : j(0), i(0) {} };

All of these are caught by GCC and I would like to enable these in VC++ and Sun Studio.

bash-4.1$ g++ -Wall main.cpp
main.cpp: In function ‘void m()’:
main.cpp:1: warning: comparison between signed and unsigned integer expressions
main.cpp:1: warning: unused variable ‘i’
main.cpp: In constructor ‘A::A()’:
main.cpp:1: warning: ‘A::j’ will be initialized after
main.cpp:1: warning:   ‘int A::i’
main.cpp:1: warning:   when initialized here

EDIT: Outside enabling signed to unsigned comparison warnings on VC++, all other options do not seem to be possible.

  • 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-23T12:30:19+00:00Added an answer on May 23, 2026 at 12:30 pm

    In Visual Studio, Project Properties, C++, set warning level to 4 (maximum) – VC++ compiler gives all possible warnings. AFAIK, warnings 1 and 2 are reported, and field initialization order is not reported by VC++ compiler.

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

Sidebar

Related Questions

When you compile the following C++ source file in Visual Studio 2010 with warning
Hoping someone can provide an answer with this, although it's not 100% programming related.
Hoping someone can help me with a slight hurdle I've come up against in
Hoping that anybody here knows about a good one: I'm looking for a (free
Hoping some learned Rails developers here can recommend an existing Ruby on Rails plugin
Hoping someone can shed some light on this: Do lookup tables need their own
Hoping someone can point me in the right direction. I'm building a online shop
Hoping that using something like this demo it is possible to drag items within
im hoping someone can help me quickly with a question i have. As site
I'm hoping there's a way to avoid custom configuration files if an application runs

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.