Browse Source
There are several small problems with the current srcpos_string(). - The code unnecessarily uses a temp buffer and two rounds of *printf(); a single asprintf() will suffice. - With previous changes, pos->file->name can never be NULL, and the name field for a srcfile bound to stdin is already set to something sensible. - On allocation failure in asprintf() it returns a bogus result, instead of causing a fatal error like every other failed allocation. - The format for representing file/line/column is gratuitously different from the file/line format we used to use, and the format used by gcc and bison. This patch addresses all of these. There remains the problem that asprintf() is not portable, but that can wait until another patch. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>main
![david@gibson.dropbear.id.au](/assets/img/avatar_default.png)
![Jon Loeliger](/assets/img/avatar_default.png)
1 changed files with 16 additions and 29 deletions
Loading…
Reference in new issue