This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Reg SEGV


Vivek Katakam writes:

 > I am actually working on a proc file and when i am running it I am
 > getting the error.
 > 
 > The code is in a file called vaprintf.c
 > 
 > These are the Lines of code from where the error came.
 >  /* Write out the message to the file. */
 >         va_start(args, input_msg);
 >         #ifdef LINUX
 >         va_copy(allargs,args);
 >         #else
 >         allargs=args;
 >         #endif
 >         vfprintf(output_file, input_msg, args);
 >         va_end(args);
 > 
 >         fputc('\n', output_file);
 >         fflush(output_file);
 >         return_value = ML_LOGGING_MESSAGE_LOGGED;
 > 
 >         va_end(args);

Why are you calling va_end() twice?  This is wrong.

You still haven't given us enough code.  In particular you haven't
show us the args that get passed to this function.  You haven't even
shown us all of this function.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]