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.

Filter by
Sorted by
Tagged with
1
vote
0answers
29 views

Solution: clang preprocessor concatenates an extra space vs. gcc - standard C99

I maintain a C library project both on gcc and clang. I am looking for advice on how to make the following macros more portable, terse, readable or standard abiding. When I compile ...
3
votes
2answers
103 views

A little C++ program to have timed rounds for a game

I know it could be better, but I’m new to C++, so I don’t know many of the tricks, along with some of the includes that are already obsolete. This program asks for names as input, adds a time for ...
4
votes
3answers
81 views

Encapsulating snprintf to simplify usage: sbprintf & swnprintf

After writing swnprintfand sbprintf in C (Encapsulating snprintf to avoid repetition of sizeof), I've written a C++ version of ...
5
votes
3answers
186 views

Encapsulating snprintf to avoid repetition of sizeof

Correct usage of snprintf involves very long and repetitive lines: ...
7
votes
2answers
155 views

Register “%b” conversion specifier

I'm writing a library to register the b, B conversion specifiers and make them work the closest possible to ...
3
votes
0answers
64 views

Generic Makefile for C projects

I'm trying to create a generic Makefile that will work with the following directory structure: Project Directory Makefile main.c source file source directory Source files include directory Header ...
0
votes
1answer
75 views

gcc constant time implemenation [closed]

I need to make the following function time constant - I have already removed if statements and have written it down to one line in the loop. ...
2
votes
1answer
128 views

Printing 64-bit decimal numbers in freestanding environment

I need to print signed 64-bit numbers in decimal form. Program runs in freestanding environment (no C library available, libgcc may be unavailable too, or may not work correctly). So I can't use ...
2
votes
0answers
51 views

String to long double conversion using FBLD

I always wanted to try fbld x87 instruction to aid to convert string to floating point value. I sure a chance to face this instruction in disassembly of all the ...
3
votes
2answers
526 views

Makefile for a small JNI project

So I'm going to publish this small project on GitHub and I thought I'd better do a makefile for it. The source code consists of 1 Java Class 1 Native JNI module written in C 1 stdlib wrapper object ...
11
votes
1answer
742 views

Computing average without overflows and with half-decent precision

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 ...
10
votes
1answer
237 views

Vectorizing the product of an array of complex numbers

I am trying to write fast/optimal code to vectorize the product of an array of complex numbers. In simple C this would be: ...