[docs] Improve 'Finding System Headers' examples for C++

Open
#5,262 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
documentation

Research direction

Start with the Importing Type Information page at the linked Import Header File and Finding System Headers sections. Add the C++ mode example and corresponding gcc and clang header-search commands, and move or repeat the relevant guidance in a general section where appropriate. Done means the documentation clearly covers both C and C++ usage, including the existing Windows context.

Written by the indexing model from the issue text.

Description

Effort: Low Impact: Low

Is this a general concept that needs to be documented or a specific API?

General

What concept or API needs more documentation?

In the 'Importing Type Information' docs:

The 'Import Header File' section mentions:

-x c -std=c99 to specify C99 mode

It might also be useful to include something for C++ mode such as:

-x c++ -std=c++14 to specify C++14 mode

Then in the 'Finding System Headers' section it provides commands for listing the system paths, but these seem to be specifically for C:

gcc -Wp,-v -E -
clang -Wp,-v -E -

It might be useful to also explicitly mention how to do the same for C++ here as well:

gcc -Wp,-v -x c++ -E -
clang -Wp,-v -x c++ -E -

The only section that seems to currently explicitly mention anything about C++ is in the Windows section:

You also want to include -x c -std=c99 since Windows headers include lots of C++ types that the type importer currently does not support.

It might be useful to have this information somewhere 'higher up' in a more 'general' section, as it was only by accident that I noticed this (since I am working on a macOS binary)

Is this documentation related to a specific API?

N/A

Are there any known examples of people using this API/concept?

This tweet thread has some context where I was originally asking how to make it work, and then eventually figured out a way to do so:

Semi-related:

Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Vector35/binaryninja-api

All issues in Vector35/binaryninja-api

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.