[llvm-bugs] [Bug 37272] New: clang-format in Allman style always indents the contents of extern "C" blocks in C headers

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 27 08:32:02 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37272

            Bug ID: 37272
           Summary: clang-format in Allman style always indents the
                    contents of extern "C" blocks in C headers
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: shlomif at shlomifish.org
                CC: llvm-bugs at lists.llvm.org

With this .clang-format:

<<<<<<<<<<<<<
---
BasedOnStyle:  LLVM
AlignAfterOpenBracket: DontAlign
BreakBeforeBraces: Allman
IndentWidth:     4
SortIncludes:    false
BraceWrapping:
    AfterExternBlock: false
>>>>>>>>>>>>>

I am getting the contents of extern "C" indented in this simple C header and
all other headers I tried:

<<<<<<<<<<<<<
/*
 * This file is part of patsolve. It is subject to the license terms in
 * the LICENSE file found in the top-level directory of this distribution
 * and at https://bitbucket.org/shlomif/patsolve-shlomif/src/LICENSE . No
 * part of patsolve, including this file, may be copied, modified, propagated,
 * or distributed except according to the terms contained in the COPYING file.
 *
 * Copyright (c) 2002 Tom Holroyd
 */
#pragma once

#include <stdio.h>

#ifdef __cplusplus
extern "C"
{
#endif

    static inline void fc_solve_msg(const char *msg, ...)
    {
        va_list ap;

        va_start(ap, msg);
        vfprintf(stderr, msg, ap);
        va_end(ap);
    }

#ifdef __cplusplus
}
#endif

>>>>>>>>>>>>>

I don't want that! Please provide an option to disable it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180427/f9d354b4/attachment.html>


More information about the llvm-bugs mailing list