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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:13:34+00:00 2026-06-12T20:13:34+00:00

I have the following .x file called paper.x . When I create a server

  • 0

I have the following .x file called paper.x . When I create a server in rpc in order to call the function the error below occurs

paperserverproc.c:23:5: error: conflicting types for ‘add_procedure_1_svc’
paper.h:46:15: note: previous declaration of ‘add_procedure_1_svc’ was here

#include <limits.h>
struct paper_saved{
    char author_name[CHAR_MAX];
    char paper_title[CHAR_MAX];
    int paper_id;
    char paper_file_name[CHAR_MAX]; 
    char  paper_content[CHAR_MAX];   
};
struct paper_info_saved{
    char author_name[CHAR_MAX];
    char paper_title[CHAR_MAX];
    int paper_id;
    char paper_file_name[CHAR_MAX]; 

};
struct list_papers{
    paper_saved paper;
    struct list_papers *next; 
}; 

program PAPER_PROGRAM
{
  version PAPER_VERSION
  {
    int ADD_PROCEDURE(paper_saved) = 1;        /* Procedure nb */
    void LIST_PROCEDURE(void)=2;
    paper_info_saved INFO_PROCEDURE(int)=3;
    paper_saved FETCH_PROCEDURE(int)=4;
    void REMOVE_PROCEDURE(int)=5;
   } = 1;                             /* Version nb */
} = 0x20001234;                      /* Program number */

I call the procedure with this way and the line 23 is the line when I declare the function as below

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "paper.h"
#include <ctype.h>
#include <limits.h>
.......
int add_procedure_1_svc(paper_saved *paper_pointer, struct svc_req *rqstp)

This is the paper.h file generated by rpcgen and I dont know what’s the problem in line 46 that it mentions

 /*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#ifndef _PAPER_H_RPCGEN
#define _PAPER_H_RPCGEN

#include <rpc/rpc.h>


#ifdef __cplusplus
extern "C" {
 #endif


struct paper_saved {
    char author_name[127];
    char paper_title[127];
    int paper_id;
    char paper_file_name[127];
     char paper_content[127];
};
typedef struct paper_saved paper_saved;

struct paper_info_saved {
    char author_name[127];
    char paper_title[127];
    int paper_id;
    char paper_file_name[127];
};
typedef struct paper_info_saved paper_info_saved;

struct list_papers {
    paper_saved paper;
     struct list_papers *next;
};
typedef struct list_papers list_papers;

#define PAPER_PROGRAM 0x20001234
#define PAPER_VERSION 1

#if defined(__STDC__) || defined(__cplusplus)
#define ADD_PROCEDURE 1
extern  int * add_procedure_1(paper_saved *, CLIENT *);
extern  int * add_procedure_1_svc(paper_saved *, struct svc_req *);
#define LIST_PROCEDURE 2
extern  void * list_procedure_1(void *, CLIENT *);
extern  void * list_procedure_1_svc(void *, struct svc_req *);
#define INFO_PROCEDURE 3
extern  paper_info_saved * info_procedure_1(int *, CLIENT *);
extern  paper_info_saved * info_procedure_1_svc(int *, struct svc_req *);
#define FETCH_PROCEDURE 4
extern  paper_saved * fetch_procedure_1(int *, CLIENT *);
extern  paper_saved * fetch_procedure_1_svc(int *, struct svc_req *);
#define REMOVE_PROCEDURE 5
extern  void * remove_procedure_1(int *, CLIENT *);
extern  void * remove_procedure_1_svc(int *, struct svc_req *);
extern int paper_program_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);

#else /* K&R C */
#define ADD_PROCEDURE 1
extern  int * add_procedure_1();
extern  int * add_procedure_1_svc();
#define LIST_PROCEDURE 2
extern  void * list_procedure_1();
extern  void * list_procedure_1_svc();
#define INFO_PROCEDURE 3
extern  paper_info_saved * info_procedure_1();
extern  paper_info_saved * info_procedure_1_svc();
#define FETCH_PROCEDURE 4
extern  paper_saved * fetch_procedure_1();
extern  paper_saved * fetch_procedure_1_svc();
#define REMOVE_PROCEDURE 5
extern  void * remove_procedure_1();
extern  void * remove_procedure_1_svc();
extern int paper_program_1_freeresult ();
#endif /* K&R C */

/* the xdr functions */

#if defined(__STDC__) || defined(__cplusplus)
extern  bool_t xdr_paper_saved (XDR *, paper_saved*);
extern  bool_t xdr_paper_info_saved (XDR *, paper_info_saved*);
extern  bool_t xdr_list_papers (XDR *, list_papers*);

#else /* K&R C */
extern bool_t xdr_paper_saved ();
extern bool_t xdr_paper_info_saved ();
extern bool_t xdr_list_papers ();

#endif /* K&R C */

#ifdef __cplusplus
}
#endif

#endif /* !_PAPER_H_RPCGEN */

So the correct one .h file is

#include <limits.h>
struct paper_saved{
    char author_name[CHAR_MAX];
    char paper_title[CHAR_MAX];
    int paper_id;
    char paper_file_name[CHAR_MAX]; 
    char  paper_content[CHAR_MAX];   
};
struct paper_info_saved{
    char author_name[CHAR_MAX];
    char paper_title[CHAR_MAX];
    int paper_id;
    char paper_file_name[CHAR_MAX]; 

};
struct list_papers{
    paper_saved paper;
    struct list_papers *next; 
}; 
typedef int p_id;
program PAPER_PROGRAM
{
  version PAPER_VERSION
  {
    p_id ADD_PROCEDURE(paper_saved) = 1;        /* Procedure nb */
    void LIST_PROCEDURE(void)=2;
    paper_info_saved INFO_PROCEDURE(int)=3;
    paper_saved FETCH_PROCEDURE(int)=4;
    void REMOVE_PROCEDURE(int)=5;
   } = 1;                             /* Version nb */
} = 0x20001234;                      /* Program number */
  • 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-12T20:13:35+00:00Added an answer on June 12, 2026 at 8:13 pm

    The function is declared as returning int:

    int add_procedure_1_svc(paper_saved *paper_pointer, struct svc_req *rqstp)
    

    but the extern as returning int*

    extern  int * add_procedure_1_svc(paper_saved *, struct svc_req *);
    

    one of them must be wrong.

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

Sidebar

Related Questions

I have the following code in a file called overlay.js: Event.observe(window, 'load', function() {
I have following data in a file called binFile 78 1 79 4 80
I have the following defined in a file called build-dependencies.xml <?xml version=1.0 encoding=UTF-8?> <project
I have a simple assembly code file called exit.s that looks like the following:
I have created a file called untitled1.cpp in dev-cpp with the following script: #include
I have the following script #!/usr/bin/Rscript print (shebang works) in a file called shebang.r.
I have a class header file called Grid.h that contains the following 2 private
I have the following text in a file called build.xml: component.rollup=true component.rollup.modules.buildfiles=io-base.xml, io-form.xml, io-xdr.xml
So I have the following code to check for the text file called Doctors.txt
I have the following example code for the knapsack problem in a file called

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.