|
-
November 8th, 2007, 09:05 PM
#1
$Super$$main()
Just see a function in xxx.c file as:
Code:
void $Sub$$main(void)
{
// blahblah.. // does some extra setup work
$Super$$main(); //calls the original function
}
====
Here i have two questions.
1. Why a function name can be declared as $...$$....
Does it have any special meaning?
2. Why did it call "itself"? What does the original function mean here?
BTW, it's a code downloaded from ARM.com
Thanks a lot for the explanation.
-
November 9th, 2007, 03:42 AM
#2
Re: $Super$$main()
To me it looks like there´s some sort of preprocessor which uses these keywords to do some things. The code itself is illegal C/C++ and won´t compile using standard C/C++ compilers.
- Guido
-
November 9th, 2007, 08:24 AM
#3
Re: $Super$$main()
It looks they are trying some inheritence stuff in plain C since the function is called SUB and the call inside is SUPER. But like GNiewerth said, this is non standard.
-
November 9th, 2007, 09:08 AM
#4
Re: $Super$$main()
Some revision control systems have a substitution mechanism that replaces keywords of the form $...$ with other values. That doesn't explain the $$ though.
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs. -- Robert Firth
-
November 9th, 2007, 09:17 AM
#5
Re: $Super$$main()
 Originally Posted by googler
Some revision control systems have a substitution mechanism that replaces keywords of the form $...$ with other values. That doesn't explain the $$ though.
Maybe it´s Micro$oft specific ?
- Guido
-
November 9th, 2007, 11:20 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|