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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:30:42+00:00 2026-05-30T13:30:42+00:00

When I use the -f I get an error segmentation fault, any ideas? the

  • 0

When I use the -f I get an error segmentation fault, any ideas?
the -f option is for choosing an input file.

  struct list_names filenames;
  list_names_init(&filenames, "filenames");

  optind = 1;
  while ((ch = getopt(argc, argv, ":hvf:")) != -1)  //where getopt defined
    {
      switch (ch) {
        case 'h':
                printf("usage: ./hake [-h] [-v] [-f file]\n-h           print help\n-v           verbose mode; enable extra printing; can be repeated\n");
                printf("-f file      input filename; default is hakefile or Hakefile");
          break;
        case 'v':
          verbose = 1;
          break;
        case 'f':
          f_flag++;
          list_names_append_from_file(&filenames, optarg);
       printf("Read_file%s\n",optarg);
       read_file(optarg);
          break;
  • 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-30T13:30:44+00:00Added an answer on May 30, 2026 at 1:30 pm

    Without knowing how list_names_append_from_file is defined it is hard to answer your question. However, a segmentation fault means that you’re almost certainly passing the wrong type or number of parameters to a function or that you’re messing up a pointer. I’d suggest recompiling (presuming you’re using gcc) with -Wall -Werror and see if the compiler doesn’t tell you what’s going wrong immediately.

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

Sidebar

Related Questions

I use the following jquery statements but i get error in this function onGetDataSuccess(result)
I get this error when I try to use time_ago_in_words : Comparison of String
When I use (1) in my xhtml, I get an error as in (2).
Currently, when I get an error on an erb template (for use with HTTPServer/cgi)
In perl 5.8.5, if I do the following, I don't get an error: use
I get the above error whenever I try and use ActionLink ? I've only
I get the following error when attempting to use django-openid-auth OpenID discovery error: No
I get an Access is Denied error message when I use the strong name
I get the following compilation error fatal error C1189: #error : ERROR: Use of
When I try to use the code below I get a duplicate variable error

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.