Skip to main content
PMath.4
Senior III
July 4, 2020
Question

Changing default parameters of main()

  • July 4, 2020
  • 2 replies
  • 819 views

I've got an application where the main() function needs to be non-standard. In older version of GCC this wasn't an issue but the newer versions seem to have changed something

I need:

void main(long long int *c, long long int *b)

but GCC is overriding this. Is there a compiler switch to let me do what has worked fine previously?

Thanks

    This topic has been closed for replies.

    2 replies

    TDK
    July 4, 2020

    How are you passing parameters to main() in an STM32 application?

    There are only two allowed forms for arguments of main() per the C standard:

    int main (void);
    int main (int argc, char* argv[]);

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    berendi
    Principal
    July 5, 2020

    > GCC is overriding this

    What do you mean by that? Does gcc rewrite the code or what?