C Program indeed can be written without a main() function.
The Priority of main function on the start-up is 0.
Priorities from 0 to 63 are used by C Library APIs
Priorities from 64 to 99 are again reserved by the C Libraries.
Any User Defined API is given priority above 100
Check the code below now:
however, the #pragma wont change priorities always. its more likely dependent on the availability of priorities.
The highest priorities of 0, 1 and 2 cannot always be assigned to all functions, and are machine dependent. An attempt to assign these priorities may result in a processor fault in some machines on runtime.
Any call to a library function, whose priority runs into the explicitly defined area, will overwrite the explicit priority definition and make space for itself.
in case of any clarifications, feel free to leave a comment.
The Priority of main function on the start-up is 0.
Priorities from 0 to 63 are used by C Library APIs
Priorities from 64 to 99 are again reserved by the C Libraries.
Any User Defined API is given priority above 100
Check the code below now:
however, the #pragma wont change priorities always. its more likely dependent on the availability of priorities.
The highest priorities of 0, 1 and 2 cannot always be assigned to all functions, and are machine dependent. An attempt to assign these priorities may result in a processor fault in some machines on runtime.
Any call to a library function, whose priority runs into the explicitly defined area, will overwrite the explicit priority definition and make space for itself.
in case of any clarifications, feel free to leave a comment.
11:09 AM





