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

more than 2048 characters in lines are wrapped and no solutions?

Hi,

So I have lines sources which are more than
2048 characters and why those are wrapped.

So I have seen at this link: http://www.keil.com/support/docs/2911.htm
the answer to my problem so I used a backslash (\) character to concatenate two source lines with the C preprocessor.

Example: long source line \ continues here

But it still wrapped lines there is still problem, I don't understand why ?

Can you help me please?

Thank you

Sems

Parents
  • I'm not sure that I know exactly what you mean. If you use the '\' continuation character, the editor will of course continue to display the source lines as multiple lines of text, but the compiler will treat them as if the contents of the individual lines where written on the same line.

    #define HUGE_MACRO(a,b) \ 
      do {\ 
        (a) *= (b);\ 
      } while ((b) && (a) < 1000);
    

    would be treated like:

    #define HUGE_MACRO(a,b) do { (a) *= (b); } while ((b) && (a) < 1000);
    

    There is no way you can get the compiler to display something longer than 2048 characters, since that is a specific hard-coded limitation by the editor.

    I can not see why you would need to worry about such a limitation. When you write code manually, you never write 2048+ character long lines. When you have auto-generated code from a tool, the tool should be smart enough to insert either new-line characters or '\' continuation characters.

    If you think that you have a problem that isn't solved with the use of continuation characters, please post an example (but make sure you reduce the size of it so it will be readable on these pages).

Reply
  • I'm not sure that I know exactly what you mean. If you use the '\' continuation character, the editor will of course continue to display the source lines as multiple lines of text, but the compiler will treat them as if the contents of the individual lines where written on the same line.

    #define HUGE_MACRO(a,b) \ 
      do {\ 
        (a) *= (b);\ 
      } while ((b) && (a) < 1000);
    

    would be treated like:

    #define HUGE_MACRO(a,b) do { (a) *= (b); } while ((b) && (a) < 1000);
    

    There is no way you can get the compiler to display something longer than 2048 characters, since that is a specific hard-coded limitation by the editor.

    I can not see why you would need to worry about such a limitation. When you write code manually, you never write 2048+ character long lines. When you have auto-generated code from a tool, the tool should be smart enough to insert either new-line characters or '\' continuation characters.

    If you think that you have a problem that isn't solved with the use of continuation characters, please post an example (but make sure you reduce the size of it so it will be readable on these pages).

Children