1

Is there a linux command that would allow you to print out the C code in the GCC header file for a specific function? For example inputting strncpy and the output would be the C code held within it. Or is the code comprised of only assembly code or something? I believe I have seen such a thing before but cannot find a command easily through searching google.

1
  • Why exactly do you ask? Are you only asking for functions defined in header files (i.e. #include-d *.h files) which are generally inline? Specifically, strncpy is in the standard libc and you could study the source code of GNU libc or MUSL libc; perhaps extending GCC With MELT might help. Commented Apr 4, 2014 at 5:35

1 Answer 1

3

Generally, there is no way to do that. Yes, a library linked with your C code could be written in assembly, or many other languages. The source code of the libraries are not needed to use them, so there is no such tool. You need to look for the sources yourself.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.