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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:48:32+00:00 2026-05-27T07:48:32+00:00

I made a small C library that implements graph theory algorithms and binds them

  • 0

I made a small C library that implements graph theory algorithms and binds them for use in Python.

I send it to a friend to check it and he told me that va_list is “dangerous” and must not be used in this kind of project.

So the question is. In which cases va_list should be used?

  • 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-27T07:48:32+00:00Added an answer on May 27, 2026 at 7:48 am

    The main problem I see is that there’s no guarantee that you really got the number of arguments that you were expecting, and no way to check for that. This makes errors undetectable, and undetectable errors are, obviously, the most dangerous kind. va_arg is also not type-safe, which means that if you pass a double and expect an unsigned long long, you’ll get garbage instead of a good-looking integer, and no way to detect it at compile-time. (It becomes much more of a mess when the types don’t even have the same size).

    Depending on the data you deal with, this may be more or less of a problem. If you pass pointers, it becomes almost instantly fatal to omit an argument because your function will retrieve garbage instead, and this could (if the planets are properly aligned) become a vulnerability.

    If you pass “regular” numeric data, it then depends on if the function is critical. In some cases you can easily detect an error looking at the function’s output, and in some practical cases it really isn’t that much of a problem if the function fails.

    It all revolves about if you’re afraid of forgetting arguments yourself, actually.

    C++11 has a variadic template feature that allows you to treat an arbitrary number of parameters in a safe way. If the step from C to C++ isn’t hurting too much, you could look into it.

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

Sidebar

Related Questions

I use distribute to package a small python library. I made a directory structure
I made small program to divide large pictures and take part of them. When
I have made a small log service that i want to publish to a
I have made a program which is a small library operated via software. When
I need to build a small JavaScript library that would only be a couple
I made a small MVC Framework, but i need that my view Class can
I made my own small thread-safe (confirmed it using many tests)library similar to Looper
I've made a small program which has 2 buttons and each does certain thing.
I have made a small application in Java and I would like to make
For a program of mine I made a small function to clear the various

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.