Raised This Month: $12 Target: $400
 3% 

Most Common Errors You Can Encounter Every Now and Then


Post New Thread Reply   
 
Thread Tools Display Modes
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 06-05-2014 , 04:08   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #11

an advice: use the spoiler tags to hide explanations, make everything as short as possible, add links of posts added about some other issues... the main post will be huge if you put everything there.

edit: make a stuctured architecture like what I did in my tutorials, I just copied from here.
__________________

Last edited by ANTICHRISTUS; 06-05-2014 at 09:35.
ANTICHRISTUS is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 06-05-2014 , 04:42   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #12

Quote:
Originally Posted by ANTICHRISTUS View Post
an advice: use the spoiler tags to hide explanations, make everything as short as possible, add links of posts added about some other issues... the main post will be huge if you put everything there.
Aye Aye Captain !!

Quote:
make a stuctured architecture like what I did in my tutorials
As soon as i am done with the contents of the post .. i ll try that .. For now i am trying to make the thread as much useful as possible.
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then

Last edited by devilicioux; 06-06-2014 at 02:55.
devilicioux is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-08-2014 , 17:46   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #13

More errors you may add. Will leave the explanation to you. Here you go:
1. Undefined symbol "<any>"
2. Must be a constant expression on line <any>
3. Array must be indexed, variable "<any>"
4. Extra characters on line on line <any>
5. Unmatched closing brace on line <any>
6. Array dimensions do not match on line <any>
7. A little thing - the error with "expected token..." may be with so many expected tokens, not only with ; and -identifier-
8. Function uses both "return" and "return <value>" on line <any>
9. Invalid string (possibly non-terminated string) on line <any>
10. Invalid expression, assumed zero on line <any>
11. Error: Empty statement on line <any>

And many many more, but I can't remember now. Will update as soon as I remember something.
__________________

Last edited by Flick3rR; 06-08-2014 at 17:46.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 06-09-2014 , 02:54   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #14

Quote:
Originally Posted by Flick3rR View Post
More errors you may add. Will leave the explanation to you. Here you go:
1. Undefined symbol "<any>"
2. Must be a constant expression on line <any>
3. Array must be indexed, variable "<any>"
4. Extra characters on line on line <any>
5. Unmatched closing brace on line <any>
6. Array dimensions do not match on line <any>
7. A little thing - the error with "expected token..." may be with so many expected tokens, not only with ; and -identifier-
8. Function uses both "return" and "return <value>" on line <any>
9. Invalid string (possibly non-terminated string) on line <any>
10. Invalid expression, assumed zero on line <any>
11. Error: Empty statement on line <any>

And many many more, but I can't remember now. Will update as soon as I remember something.
Thank you I do have the list of all errors Its just i am Lazy
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-09-2014 , 05:45   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #15

Didn't understand that. Will stop posting then, but it will be good if you make the list full with all errors, so they can be easy to find and solute. Good thread, by the way!
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 06-09-2014 , 08:23   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #16

Quote:
Originally Posted by Flick3rR View Post
Didn't understand that. Will stop posting then, but it will be good if you make the list full with all errors, so they can be easy to find and solute. Good thread, by the way!
I meant this

PHP Code:
/*001*/  "expected token: \"%s\", but found \"%s\"\n",
/*002*/  "only a single statement (or expression) can follow each \"case\"\n",
/*003*/  "declaration of a local variable must appear in a compound block\n",
/*004*/  "function \"%s\" is not implemented\n",
/*005*/  "function may not have arguments\n",
/*006*/  "must be assigned to an array\n",
/*007*/  "operator cannot be redefined\n",
/*008*/  "must be a constant expression; assumed zero\n",
/*009*/  "invalid array size (negative or zero)\n",
/*010*/  "invalid function or declaration\n",
/*011*/  "invalid outside functions\n",
/*012*/  "invalid function call, not a valid address\n",
/*013*/  "no entry point (no public functions)\n",
/*014*/  "invalid statement; not in switch\n",
/*015*/  "\"default\" case must be the last case in switch statement\n",
/*016*/  "multiple defaults in \"switch\"\n",
/*017*/  "undefined symbol \"%s\"\n",
/*018*/  "initialization data exceeds declared size\n",
/*019*/  "not a label: \"%s\"\n",
/*020*/  "invalid symbol name \"%s\"\n",
/*021*/  "symbol already defined: \"%s\"\n",
/*022*/  "must be lvalue (non-constant)\n",
/*023*/  "array assignment must be simple assignment\n",
/*024*/  "\"break\" or \"continue\" is out of context\n",
/*025*/  "function heading differs from prototype\n",
/*026*/  "no matching \"#if...\"\n",
/*027*/  "invalid character constant\n",
/*028*/  "invalid subscript (not an array or too many subscripts): \"%s\"\n",
/*029*/  "invalid expression, assumed zero\n",
/*030*/  "compound statement not closed at the end of file\n",
/*031*/  "unknown directive\n",
/*032*/  "array index out of bounds (variable \"%s\")\n",
/*033*/  "array must be indexed (variable \"%s\")\n",
/*034*/  "argument does not have a default value (argument %d)\n",
/*035*/  "argument type mismatch (argument %d)\n",
/*036*/  "empty statement\n",
/*037*/  "invalid string (possibly non-terminated string)\n",
/*038*/  "extra characters on line\n",
/*039*/  "constant symbol has no size\n",
/*040*/  "duplicate \"case\" label (value %d)\n",
/*041*/  "invalid ellipsis, array size is not known\n",
/*042*/  "invalid combination of class specifiers\n",
/*043*/  "character constant exceeds range for packed string\n",
/*044*/  "positional parameters must precede all named parameters\n",
/*045*/  "too many function arguments\n",
/*046*/  "unknown array size (variable \"%s\")\n",
/*047*/  "array sizes do not match, or destination array is too small\n",
/*048*/  "array dimensions do not match\n",
/*049*/  "invalid line continuation\n",
/*050*/  "invalid range\n",
/*051*/  "invalid subscript, use \"[ ]\" operators on major dimensions\n",
/*052*/  "multi-dimensional arrays must be fully initialized\n",
/*053*/  "exceeding maximum number of dimensions\n",
/*054*/  "unmatched closing brace\n",
/*055*/  "start of function body without function header\n",
/*056*/  "arrays, local variables and function arguments cannot be public (variable \"%s\")\n",
/*057*/  "unfinished expression before compiler directive\n",
/*058*/  "duplicate argument; same argument is passed twice\n",
/*059*/  "function argument may not have a default value (variable \"%s\")\n",
/*060*/  "multiple \"#else\" directives between \"#if ... #endif\"\n",
/*061*/  "\"#elseif\" directive follows an \"#else\" directive\n",
/*062*/  "number of operands does not fit the operator\n",
/*063*/  "function result tag of operator \"%s\" must be \"%s\"\n",
/*064*/  "cannot change predefined operators\n",
/*065*/  "function argument may only have a single tag (argument %d)\n",
/*066*/  "function argument may not be a reference argument or an array (argument \"%s\")\n",
/*067*/  "variable cannot be both a reference and an array (variable \"%s\")\n",
/*068*/  "invalid rational number precision in #pragma\n",
/*069*/  "rational number format already defined\n",
/*070*/  "rational number support was not enabled\n",
/*071*/  "user-defined operator must be declared before use (function \"%s\")\n",
/*072*/  "\"sizeof\" operator is invalid on \"function\" symbols\n",
/*073*/  "function argument must be an array (argument \"%s\")\n",
/*074*/  "#define pattern must start with an alphabetic character\n",
/*075*/  "input line too long (after substitutions)\n",
/*076*/  "syntax error in the expression, or invalid function call\n",
/*077*/  "malformed UTF-8 encoding, or corrupted file: %s\n",
/*078*/  "function uses both \"return\" and \"return <value>\"\n",
/*079*/  "inconsistent return types (array & non-array)\n",
/*080*/  "unknown symbol, or not a constant symbol (symbol \"%s\")\n",
/*081*/  "cannot take a tag as a default value for an indexed array parameter (symbol \"%s\")\n",
/*082*/  "user-defined operators and native functions may not have states\n",
/*083*/  "a function may only belong to a single automaton (symbol \"%s\")\n",
/*084*/  "state conflict: one of the states is already assigned to another implementation (symbol \"%s\")\n",
/*085*/  "no states are defined for function \"%s\"\n",
/*086*/  "unknown automaton \"%s\"\n",
/*087*/  "unknown state \"%s\" for automaton \"%s\"\n",
/*088*/  "number of arguments does not match definition\n" 
I ll add more to the main post slowly till all the errors are covered

Quote:
Originally Posted by Flick3rR View Post
Good thread, by the way!
Thank you !
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-09-2014 , 18:23   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #17

Break your post into sections by Compile Warning, Compile Error and Run-Time Error
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 06-10-2014 , 07:46   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #18

More Content Added.

Quote:
Originally Posted by YamiKaitou View Post
Break your post into sections by Compile Warning, Compile Error and Run-Time Error
Sure.
As soon as the post content is finished and all errors and warnings are covered .. I ll do that.
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 06-12-2014 , 09:41   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #19

This thread is a good idea. I have some recommendations for you:

I would strongly recommend sectioning the post more to clearly distinguish between compiler errors, warnings and run-time errors. Right now it is confusing that you frequently switch between different classes of errors.

Have a useful ordering for your examples. Starting off with run-time error 10, continuing with error 3 and then going back to 11 makes skimming through the list cumbersome.

Many of your examples could use proper code snippets that briefly show how the error typically looks like. Too many of your examples contain "you already know what's wrong" style answers, which is not helpful when someone gets stuck and actually has to search for a thread like this.

You list some specific examples for run-time error 10 and have them scattered throughout the list. You should explain in a generic way what "error 10" means and only then give some specific examples that are frequently encountered or especially cryptic.

The list also mixes three styles of explanation: Full explanation by you, explanation supplemented with a user post and a direct link to a user post. I think this thread would ideally contain an explanation for all the errors directly, such that it is useful standing on it's own. Where necessary the explanations can then be supported by links to more in-depth explanations.

Some factual issues:

Quote:
Originally Posted by devilicioux View Post
1. Syntax Errors
This is encountered when you are trying to interpret syntactically invalid code.
Example : Tag Mismatch, Invalid Function Call etc
A tag mismatch is a warning, not an error.

Quote:
Originally Posted by devilicioux View Post
4. [CSTRIKE] Invalid player / [FUN] Invalid player etc
Solution :
PHP Code:
#define IsPlayer(%1) ( 1 <= %1 <= gMaxClients )
.
.
.
//Now before operating on the player 
if(is_user_connected(id) && IsPlayer(id))
{
//Do the stuff here.

This is not helpful. is_user_connected already performs the IsPlayer check you are suggesting here:

PHP Code:
if (index || index gpGlobals->maxClients)
        return 
0
__________________
In Flames we trust!
Nextra is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-12-2014 , 15:46   Re: Most Common Errors You Can Encounter Every Now and Then
Reply With Quote #20

Quote:
Originally Posted by devilicioux View Post
21. error 075: input line too long (after substitutions)
Thanks to Black Rose for the nice explanation of why the error occurs and how to avoid this error HERE
I do not explain anything. How it occurs is pretty self-explanatory. How to avoid it is too.
The code I posted is just a display of how it is impossible to make a bigger 2d/3d array optional.
__________________
Black Rose is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode