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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:38:04+00:00 2026-06-09T11:38:04+00:00

When creating custom typedefs for integers, is it possible for compiler to warn when

  • 0

When creating custom typedefs for integers, is it possible for compiler to warn when you when using a default numeric type?

For example,

typedef int_fast32_t    kint;

int_fast32_t test=0;//Would be ok
kint test=0; //Would be ok
int test=0; //Would throw a warning or error

We’re converting a large project and the default int size on platform is 32767 which is causing some issues. This warning would warn a user to not use ints in the code.

If possible, it would be great if this would work on GCC and VC++2012.

  • 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-06-09T11:38:05+00:00Added an answer on June 9, 2026 at 11:38 am

    I’m reasonably sure gcc has no such option, and I’d be surprised if VC did.

    I suggest writing a program that detects references to predefined types in source code, and invoking that tool automatically as part of your build process. It would probably suffice to search for certain keywords.

    Be sure you limit this to your own source files; predefined and third-party headers are likely to make extensive use of predefined types.

    But I wouldn’t make the prohibition absolute. There are a number of standard library functions that use predefined types. For example, in c = getchar() it makes no sense to declare c as anything other than int. And there’s no problem for something like for (int i = 0; i <= 100; i ++) ...

    Ideally, the goal should be to use predefined types properly. The language has never guaranteed that an int can exceed 32767. (But “proper” use is difficult or impossible to verify automatically.)

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

Sidebar

Related Questions

I'm creating custom UserControl in ASP.NET and I'm using System.ComponentModel.Attributes to decorate properties with
I am creating custom code snippet templates using DevExpress' CodeRush. Is there anyway for
I'm creating a custom iterator type, and the only use case right now is
I am having some problems creating custom types for my data table, using jquery.datatables.js.
I have a Rails blog using friendly_id for creating custom urls. The blog has
I am creating custom ViewGroup in which I am using onLayout method in which
I was creating custom content model in datalistModel.xml <type name=dl:car> <title>Car List</title> <parent>dl:dataListItem</parent> <properties>
Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged
I have a custom object that is using a typedef enum. If I set
I was used to creating Custom Cells in MonoTouch using Interface Builder but ever

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.