<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - clang-format mistakenly recognize C file as Objective C and fails to format it"
href="https://bugs.llvm.org/show_bug.cgi?id=48580">48580</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-format mistakenly recognize C file as Objective C and fails to format it
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>anton.kochkov@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>If I try to run "clang-format -i minimized.h" fails with the following
".clang-format" it returns the following error:
Configuration file(s) do(es) not support Objective-C: /home/user/.clang-format
Here is the minimized.h:
static insn_head_t c55x_list[] = {
{
.insn = {
.i_list = (insn_item_t []) {
{
.syntax = INSN_SYNTAX(mack[r] Tx, K8, [ACx,] ACy),
},
},
},
},
};
As you can see there is nothing about Objective C in this file.
Here is .clang-format contents:
Language: Cpp
MaxEmptyLinesToKeep: 1
SpaceBeforeParens: ControlStatementsExceptForEachMacros
SpaceInEmptyParentheses: false
SpacesInContainerLiterals: true
BasedOnStyle: LLVM
ContinuationIndentWidth: 8
IndentCaseLabels: false
IndentFunctionDeclarationAfterType: false
IndentWidth: 8
UseTab: ForContinuationAndIndentation
ColumnLimit: 0
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
AllowShortIfStatementsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlignAfterOpenBracket: DontAlign
AlignEscapedNewlines: DontAlign
AlignConsecutiveMacros: true
AlignTrailingComments: false
AlignOperands: false
Cpp11BracedListStyle: false
ForEachMacros: ['r_list_foreach', 'ls_foreach', 'fcn_tree_foreach_intersect',
'r_skiplist_foreach', 'graph_foreach_anode']
SortIncludes: false
See the pull requests that tries to add `clang-format` support in our project
for more details if there is a need for any:
<a href="https://github.com/rizinorg/rizin/pull/159">https://github.com/rizinorg/rizin/pull/159</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>