Skip to content

inconsistent versions of clang-format between platforms #9247

@indirectlylit

Description

@indirectlylit

Bug type: Language Service

Describe the bug

Context:

  • Host OS: Latest mac os on x86
  • Remote OS: SSH into remote device with ubuntu 18 on 64-bit ARM
  • VS Code Version: 1.66.2 (Universal)
  • C/C++ Extension Version: 1.9.8

The version of clang-format installed into the remote device is v10.0.0:

~/.vscode-server/extensions/ms-vscode.cpptools-1.9.8-linux-arm64/LLVM/bin/clang-format --version
clang-format version 10.0.0 (https://github.com/llvm/llvm-project d32170dbd5b0d54436537b6b75beaf44324e0c28)

The version on the host is v13.0.0:

~/.vscode/extensions/ms-vscode.cpptools-1.9.8-darwin-x64/LLVM/bin/clang-format --version 
clang-format version 13.0.0 (https://github.com/llvm/llvm-project d7b669b3a30345cfcdb2fde2af6f48aa4b94845d)

My .clang-format file was created using v13. When run on the remote device it doesn't work and gives errors along the lines of Error reading ... Invalid argument.

Steps to reproduce

  1. On mac, generate a new config with clang-format -style=Chromium -dump-config > .clang-format
  2. Add to repo
  3. Check out repo on remote ARM device
  4. Connect to remote ARM device in VS Code
  5. Try to save and format a cpp file

Expected behavior

The version of clang-format should preferably always be 13+

Work-around

Regenerating the config using clang-format v10 and comparing with my existing .clang-format file allowed me to find all instances of newer arguments and options. I re-saved my config to be v10-compatible.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions