LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 17753 - Clang adds initial newline for files that start with UTF-8 BOM.
Summary: Clang adds initial newline for files that start with UTF-8 BOM.
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Formatter (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Alexander Kornienko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-31 08:24 PDT by Thomas
Modified: 2013-11-13 08:04 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas 2013-10-31 08:24:47 PDT
When formatting a file that contains a UTF-8 BOM the result will include a newline character.

Hexdump before:
0000000: efbb bf23 696e 636c 7564 6520 3c69 6f73  ...#include <ios
0000010: 7472 6561 6d3e 0a0a 7573 696e 6720 6e61  tream>..using na

Hexdump after:
0000000: efbb bf0a 2369 6e63 6c75 6465 203c 696f  ....#include <io
0000010: 7374 7265 616d 3e0a 0a75 7369 6e67 206e  stream>..using n

Tested on revision 193745 on Linux, Debian Testing.
Comment 1 Alexander Kornienko 2013-11-13 08:04:48 PST
Fixed in r194576.