This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C runtime environment setup by "#pragma asm"

I am checking some terrible C source code; I haven't got any idea about how to maintain it or cooperate with it. But I found a very fundamental problem. It does NOT have a startup.asm; it has a startup.c using the powerful C extension "#pragma". So, the C runtime environment is setup by "#pragma section", "#pragma intvect", "#pragma asm". I quite worry about such a startup.c; so I contacted the FAE of our local distributor. The FAE is an experienced good engineer, but he told me that, this is not their standard way to setup C runtime environment; they definitely provided the startup.s from Day 1.

What will be the side-effect, when the C runtime environment is setup by the C extension "#pragma"?

Parents
  • I decided to take the opinions from Mike and Hans-Bernhard.

    I got an original paper copy of the startup.c and other c-files, they look better. Most of the suspicious portions are not written by the mentioned third party, it is added by users.

    Of course, the Fujitsu startup.asm is much better, and more reliable.

    But, to minimize the effort, and maintain the compatibility, I will remedy the current startup.c, based on the original paper copy; and focus on the other critical problems, like a very huge single main.c .

Reply
  • I decided to take the opinions from Mike and Hans-Bernhard.

    I got an original paper copy of the startup.c and other c-files, they look better. Most of the suspicious portions are not written by the mentioned third party, it is added by users.

    Of course, the Fujitsu startup.asm is much better, and more reliable.

    But, to minimize the effort, and maintain the compatibility, I will remedy the current startup.c, based on the original paper copy; and focus on the other critical problems, like a very huge single main.c .

Children
  • "But, to minimize the effort, and maintain the compatibility, I will remedy the current startup.c, based on the original paper copy; and focus on the other critical problems, like a very huge single main.c ."

    I would find it risky to attempt changing something you don't fully understand.

    from what you described, the .c startup file seems to be working and the problem of its poor documentation can be remedied later, probably after you have fixed other problems, like introducing more structure to the user code.

    it allows you more time to learn about the start-up and the .c startup code.

    but then that's just me.