Skip to main content

Questions tagged [gcc]

For code written to be compiled specifically by the GCC, which stands for the GNU Compiler Collection. Developers often compile several languages using this compiler collection.

11 votes
3 answers
2k views

I'm writing a library to register the b, B conversion specifiers and make them work the closest possible to ...
alx - recommends codidact's user avatar
11 votes
1 answer
1k views

At some point I needed to compute the average of a big collection of integers. I knew the size of the collection prior computation, but a naive average computation was prone to integer overflow while ...
Morwenn's user avatar
  • 20.2k
10 votes
3 answers
6k views

Design A template class that will create a concrete instance of an interface class when given the name (as a string) of the concrete class. This design is often seen in code, so the purpose of this ...
Blue7's user avatar
  • 373
10 votes
1 answer
736 views

I am trying to write fast/optimal code to vectorize the product of an array of complex numbers. In simple C this would be: ...
Simd's user avatar
  • 231
8 votes
3 answers
703 views

I've implemented the 3 variants of the modulo operation described on this Wikipedia page. The goal is to have fully defined behavior for all inputs. Code Implementation with truncated division (result ...
Cl00e9ment's user avatar
7 votes
5 answers
2k views

[edit] Hint: a similar project for C++20 which - as far as I see - also manages bigger than 128-bit integers can be found at: Infinite precision integer in C++20 . [/edit] I work on some performance ...
user1018684's user avatar
7 votes
6 answers
789 views

Is there a more direct way (loop-free) to compute this number than computing a level and then going back? ...
CPlus's user avatar
  • 1,467
7 votes
2 answers
935 views

This is version 2 of prior post - per : CRSE:tour and Guide. Due to unintended generalization of prior question for brevity sake, here are requirements: Code should be portable and run on ...
Danilo's user avatar
  • 367
7 votes
1 answer
560 views

I've been playing with shared libraries and core functionalities with gcc/g++. Using only gcc builtins I've tried to make an integer to string converter. ...
Danilo's user avatar
  • 367
7 votes
2 answers
828 views

C23 has introduced attribute specifier sequences. Consequently, the header below attempts to conditionally define macros for these sequences (for my own use cases). In cases where a compiler does not ...
Madagascar's user avatar
  • 10.1k
7 votes
4 answers
1k views

Correct usage of snprintf involves very long and repetitive lines: ...
alx - recommends codidact's user avatar
6 votes
2 answers
6k views

When working on my projects, I often need a 128-bit integer type. For this purpose, I use the __int128 compiler extension. Here is the implementation I am currently ...
DaBler's user avatar
  • 309
6 votes
2 answers
1k views

This is a simple bash script that I use to compile and run single C++ files for coding competitions. Features: Detects if there is a corresponding .in file next to ...
thesilican's user avatar
5 votes
3 answers
520 views

After writing swnprintfand sbprintf in C (Encapsulating snprintf to avoid repetition of sizeof), I've written a C++ version of ...
alx - recommends codidact's user avatar
4 votes
1 answer
1k views

We all know the classic version of counting the number of elements in a C array: sizeof(a)/sizeof(*a) But this is dangerous, because if used on a pointer it will ...
klutt's user avatar
  • 913

15 30 50 per page