[cute_sound] CUTE_SOUND_SCALAR_MODE unreachable

Open Beginner friendly
#445 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
c

Research direction

The two preprocessor conditions named in the issue are at about lines 444 and 469 of the cute_sound header in this repo. Add parentheses around the NEON and SSE defined(...) groups so the !defined(CUTE_SOUND_SCALAR_MODE) check applies to all of them. Done when compiling with CUTE_SOUND_SCALAR_MODE defined takes the scalar path without errors on x86 and ARM builds.

Written by the indexing model from the issue text.

Description

Hi Randy,

cute_sound v3.00 contains the CUTE_SOUND_SCALAR_MODE flag, which helps with compatibility in some cases. However, this flag is checked with broken logic that fails the GCC preprocessor's order of operations.

Line 444

#if !defined(CUTE_SOUND_SCALAR_MODE) && defined(__ARM_NEON) || defined(__ARM_NEON__)

Should be

#if !defined(CUTE_SOUND_SCALAR_MODE) && (defined(__ARM_NEON) || defined(__ARM_NEON__))

Line 469

#elif !defined(CUTE_SOUND_SCALAR_MODE) && defined(__SSE__) || defined(__SSE2__) || defined(__SSE3__) || defined(__SSE4_1__) || defined(__SSE4_2__)

Should be

#elif !defined(CUTE_SOUND_SCALAR_MODE) && (defined(__SSE__) || defined(__SSE2__) || defined(__SSE3__) || defined(__SSE4_1__) || defined(__SSE4_2__))

This allows the scalar mode to compile.

Dominant language
C
Stars
5.1k
Forks
316
Avg merge
28m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 RandyGaul/cute_headers

All issues in RandyGaul/cute_headers

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.