[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] More details when using tcc_set_error_func
From: |
Vladimir Vissoultchev |
Subject: |
Re: [Tinycc-devel] More details when using tcc_set_error_func |
Date: |
Tue, 12 Apr 2016 17:49:53 +0300 |
The format of the error messages is {file}:[{line}:] {severity}: {message}
Line is optional as it is not always available, {file} can also be not
available when the error is not a compilation one but error in supplied
options for instance. Then {file} is replaced with "tcc" placeholder.
Probably an option line_num parameter on the callback will simplify your
case a lot.
cheers,
</wqw>
-----Original Message-----
From: Tinycc-devel [mailto:address@hidden
On Behalf Of Richard Brett
Sent: Monday, April 11, 2016 6:51 AM
To: address@hidden
Subject: [Tinycc-devel] More details when using tcc_set_error_func
Hello
If I use the function tcc_set_error_func() the function that gets called
has a text string describing the error. Is there any standardisation of
this message line - sometimes it seems to be
<string>:19: xyz.... Othertimes it has more prefixes to the message.
What I am really after is the line number likely to be generating the
error message. I can extract from the string, but is there some other
way - not all the error messages have line numbers, so reading the string
isnt totally robust.
My environment is that I am using libtcc to compile inside another program,
C is being used as an additional scripting language. Users write their
"programs" inside an editor in the program directly. The only problem is if
the entered program has an error of some kind, it is hard for me to direct
the user to the area likely to be causing the issue. Ideally I want to take
them back to the editor and highlight the
line(s) in question.
I am happy to hunt around in the source, but as I'm new to tcc I want to
check there isnt something obvious I dont know about.
Regards
rlb
_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel