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

  • Home
  • SEARCH
  • 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 4058582
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:05:51+00:00 2026-05-20T15:05:51+00:00

I am on Linux and gcc 4.2.3. For the below code portion, lp_parm_talloc_string function

  • 0

I am on Linux and gcc 4.2.3.

For the below code portion, lp_parm_talloc_string function is called implicitly and afterwards it is defined:

char *lp_parm_string(const char *servicename, const char *type, const char *option)
{
        return lp_parm_talloc_string(lp_servicenumber(servicename), type, option, NULL);
}

/* Return parametric option from a given service. Type is a part of option before ':' */
/* Parametric option has following syntax: 'Type: option = value' */
/* the returned value is talloced in lp_talloc */
char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def)
{
        param_opt_struct *data = get_parametrics(snum, type, option);

        if (data == NULL||data->value==NULL) {
                if (def) {
                        return lp_string(def);
                } else {
                        return NULL;
                }
        }

        return lp_string(data->value);
}

For this portion the below error comes up:

param/loadparm.c:2236: error: conflicting types for 'lp_parm_talloc_string'
param/loadparm.c:2229: error: previous implicit declaration of 'lp_parm_talloc_string' was here

How to tell compiler to allow such this case?

  • 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-20T15:05:52+00:00Added an answer on May 20, 2026 at 3:05 pm

    You need to declare your function before using it:

    char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def);
    
    char *lp_parm_string(const char *servicename, const char *type, const char *option)
    {
        return lp_parm_talloc_string(lp_servicenumber(servicename), type, option, NULL);
    }
    
    // ...and the rest of your code
    

    Or simply change the order the two functions appear in your source.

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

Sidebar

Related Questions

Ok, this compiles fine in GCC under Linux. char * _v3_get_msg_string(void *offset, uint16_t *len)
I'm fine working on Linux using gcc as my C compiler but would like
I am working on Linux with the GCC compiler. When my C++ program crashes
I don't understand how GCC works under Linux. In a source file, when I
I wish to build a compiler (GCC port) for Linux, so that the built
I'm porting a small C++ console application from windows to linux, GCC 4.3.2. When
Compiling on linux using gcc. I would like to convert this to hex. 10
When I compile my code,I write gcc -g -Wall dene2 dene2.c in the console.
Can anyone explain why the following code does not compile (on g++ (GCC) 3.2.3
I've installed GCC 3.4 to /opt/gcc-3.4, and I'm using it to compile legacy code

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.