Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make clang-format play nice with other line endings #17556

Closed
ismail opened this issue Sep 10, 2013 · 5 comments
Closed

Make clang-format play nice with other line endings #17556

ismail opened this issue Sep 10, 2013 · 5 comments
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@ismail
Copy link
Contributor

ismail commented Sep 10, 2013

Bugzilla Link 17182
Resolution FIXED
Resolved on Nov 13, 2013 08:58
Version trunk
OS Linux
Attachments Sample file

Extended Description

cat sha1.cpp
#define sha1macro(func,val)
{
const unsigned int t = rol(a, 5) + (func) + e + val + w[round];
e = d;
}

clang-format sha1.cpp
Can't find usable .clang-format, using LLVM style
#define sha1macro(func, val)
{
const unsigned int t = rol(a, 5) + (func) + e + val + w[round];
e = d;
}

sha1.cpp attached.

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 10, 2013

That works fine here, results in:

#define sha1macro(func, val)
{
const unsigned int t = rol(a, 5) + (func) + e + val + w[round];
e = d;
}

Can you provide more details? Which version of clang-format are you running, which platform are you running on, etc.?

One thought, does that file contain windows line endings ()?

@ismail
Copy link
Contributor Author

ismail commented Sep 10, 2013

That works fine here, results in:

#define sha1macro(func, val)
{
const unsigned int t = rol(a, 5) + (func) + e + val + w[round];
e = d;
}

Can you provide more details? Which version of clang-format are you running,
which platform are you running on, etc.?

Linux, clang r190394

One thought, does that file contain windows line endings ()?

Yes it does and if I convert those newlines into Unix one clang-format works fine.

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 11, 2013

Most of the issues related to CR LF line endings are fixed in r190519. Starting from this revision, clang-format should correctly handle both LF and CR LF line endings, and output replacements with the line ending style prevalent in the input file.

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 13, 2013

*** Bug llvm/llvm-bugzilla-archive#17269 has been marked as a duplicate of this bug. ***

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#17269

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

2 participants