PostgREST / PostgREST/CParseC

clang fails freestanding test at `-O0` because it assumes `memcpy/memset` calls

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
91
Forks
3
Avg merge
13d 22h
Merged PRs (30d)
1

Description

Problem

Doing:

make CC=clang  test && nm -u build/freestanding

Gives:

...
cc -std=c99 -Wextra -Wall -Werror -O0 -I. -ffreestanding -c test/freestanding.c -o build/freestanding
...


                 U memcpy
                 U memset

For some reason it assumes those calls. gcc doesn't.

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.

Research direction

Start by running make CC=clang test followed by nm -u build/freestanding, then inspect test/freestanding.c and the make test target. Compare the clang and GCC builds at -O0 with -ffreestanding; done means the clang build completes without unresolved memcpy or memset symbols.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.