CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: $Super$$main()

  1. #1
    Join Date
    Sep 2003
    Location
    M...N
    Posts
    220

    $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.

  2. #2
    Join Date
    Nov 2006
    Location
    Essen, Germany
    Posts
    1,344

    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

  3. #3
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    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.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  4. #4
    Join Date
    Dec 2005
    Posts
    642

    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

  5. #5
    Join Date
    Nov 2006
    Location
    Essen, Germany
    Posts
    1,344

    Re: $Super$$main()

    Quote 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

  6. #6
    Join Date
    Apr 2003
    Posts
    93

    Re: $Super$$main()

    Probably CodeSnippets?
    OutputDebugString(...); Is your friend!
    http://www.spikedsoftware.co.uk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured