This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline asm string/line break rules change


>No one has answered the question which would convince me this is a 
>warranted change.  What is the real technical merit for doing this?
>If there is a valid technical reason, then I will suck it up and
>start to modify code.  

The multi-line strings feature resulted in confusing and incorrect error
messages.  This problem was difficult to solve.

Consider this testcase:

char *a = "a
        ";
char *b = "b
char *c = "c";
char *d = "d";

The error is on line 3.  Gcc 2.96 gives this output:
tmp.c:5:13: missing terminating " character
tmp.c:1:11: possible start of unterminated string literal

There is no mention of line 3.  It is impossible for gcc to know when you
have intentionally used a multi-line string, and when you have accidentally
used a multi-line string, so it can't know which multi-line string is the
wrong one.  For a 5 line testcase it is easy to spot the error, but if this
is a 5000 line file, and gcc gives you useless line numbers, then you have a
big problem.  The multi-line strings feature doesn't add any expressiveness
to the language.  It only lets you avoid typing a few characters.  Thus it
isn't strictly necessary for any program.  And since the feature creates
problems, the best solution is to eliminate the problematic feature.

You are right that there is now a problem with extended asms, but as others
have mentioned, that is probably best solved by improving the syntax of
extended asms.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]