Gammon Forum
Entire forum
ROM
Compiling the server
Inline warnings
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Robert Powell
Australia (367 posts) bio
|
Date
| Mon 26 Oct 2009 03:20 AM (UTC) |
Message
|
/usr/include/bits/stdio2.h:79: warning: call to int __builtin___vsnprintf_chk(char*, unsigned int, int, unsigned int, const char*, char*) will always overflow destination buffer
void BufPrintf ( BUFFER * buffer, char * fmt, ... )
{
char buf[MSL];
va_list args;
va_start ( args, fmt );
vsnprintf ( buf, LBUF, fmt, args );
va_end ( args );
add_buf ( buffer, buf );
return;
}
Ok, from what i can gather inline errors come up from using the wrong tool for the job, the others i have been able to fix myself, but i do not know what to do with this one, what should be used in this situation instead of vsnprintf. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | top |
|
Posted by
| David Haley
USA (3,881 posts) bio
|
Date
| Reply #1 on Mon 26 Oct 2009 04:28 AM (UTC) Amended on Mon 26 Oct 2009 04:29 AM (UTC) by David Haley
|
Message
| You need to make sure that you're using the right size. Why are you allocating a buffer of size MSL, but telling vsnprintf to use size LBUF? Basically, the compiler is telling you that this is guaranteed to fail, because it can see that LBUF is bigger than the size of buf, which is MSL.
By the way, what is the "inline warning" here? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | top |
|
Posted by
| Robert Powell
Australia (367 posts) bio
|
Date
| Reply #2 on Mon 26 Oct 2009 06:55 AM (UTC) |
Message
| LOL yeah i posted the wrong warning and associated code, i will get to the inlines soon :) |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
14,368 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.