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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:46:43+00:00 2026-06-16T07:46:43+00:00

Are there any tools (preferably on linux) that can warn when an argument is

  • 0

Are there any tools (preferably on linux) that can warn when an argument is defined as a smaller array then the prototype specifies?

eg:

void somefunc(float arg[10]);  /* normally this would be defined in a header */

void my_func(void)
{
    float arg[2];
    somefunc(arg);  /* <-- this could be a warning */
}

I realize this isn’t invalid code but it could resolve some common mistakes if it were possible to warn of it (ran into one of these bugs recently).

Some tools (clang static checker for eg), will warn if the function is in the same file and sets a value outside the array bounds, but I was wondering if anything will warn if the arg is smaller then the prototype alone.

I’ve used cppcheck, clang, smatch, splint, gcc’s -Wextra… but none complain of this.

  • 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-16T07:46:45+00:00Added an answer on June 16, 2026 at 7:46 am

    Since asking this question, cppcheck has added this feature in response to my suggestion (thanks guys!),

    Commit:
    https://github.com/danmar/cppcheck/commit/7f6a10599bee61de0c7ee90054808de00b3ae92d

    Issue:
    http://sourceforge.net/apps/trac/cppcheck/ticket/4262

    At the time of writing this isn’t yet in a release, but I assume it will be in the next release.

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

Sidebar

Related Questions

Are there any tools that can look at a database, and generate the basic
Are there any tools/libraries on Windows that can help me tarck down the culprit?
Is there any program (preferably official) for Windows that can be used to manipulate
I wonder is there any tool (preferably free) that can generate Java source code
Are there any tools that I can run on my server to monitor multiple
Are there any good (preferably free) tools out there? Can they give accurate estimates
are there any solid tools (preferably command line tools for linux) for exporting mysql
Are there any tools/ ant tasks that could be integrated into the ant build
Are there any tools available that will let me rebase in git style an
Are there any tools that display output of a line of code such as

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.