Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
2 replies
85 views

Using vcpkg on Windows 11, I installed GSL (GNU Scientific Library) with vcpkg install gsl. Then I did set INCLUDE=E:\<mypath>\vcpkg\installed\x64-windows\include;%INCLUDE% set LIB=E:\<mypath&...
Raymond's user avatar
  • 183
4 votes
0 answers
160 views

I am looking for information about the following preprocessor #pragma directive: #include <string> class Base { public: void Test(); }; int main() { Base b; b.Test(); return 0; ...
Kerbiter's user avatar
  • 102
2 votes
1 answer
87 views

I'm defining some tests for a library I'm using. One of my tests is calling the code in such a way that it produces warnings, which is expected. However, I'd ideally like to suppress these warnings ...
plentyofcoffee's user avatar
2 votes
3 answers
110 views

We are working with the following code: int i, j, k; for (i = 2; i < n; i++){ // S1 for (j = 3; j < n - 3; j++){ // S2 for (k = 4; k < n - 4; k++){ // S3 A[...
user31223185's user avatar
0 votes
1 answer
63 views

So I have these two macros #define ESTART \ _Pragma("optimize(\"\", off)") \ _Pragma("section(\".secure\", execute, read, write)") \ _Pragma("...
Aspis's user avatar
  • 7
1 vote
1 answer
53 views

I'm trying to migrate a small table on local SQLite database to a remote postgresql server, but I'm getting error message "(psycopg2.errors.SyntaxError) syntax error at or near "PRAGMA" ...
Osvaldo Carvalho's user avatar
1 vote
1 answer
63 views

I want to provide a function to convert parameters, which are read as long long or long double from XML, to any type constructible from these types with narrowing conversion. But I want to use list ...
H.v.M.'s user avatar
  • 1,746
0 votes
1 answer
44 views

In visual studio, does pragma comment link same library multiple times if written multiple times? Or comments second onwards ignored? I've checked comment but it doesn't seem to be clearly stated.
yoonsoh's user avatar
  • 73
0 votes
0 answers
53 views

I'm learning the basics of High-Level Synthesis (HLS) using AMD/Xilinx tools. Most courses use older tools for the practical examples (Vivado HLS instead of Vitis 2024.2 which I'm using). This is the ...
ricardovaras_99's user avatar
1 vote
1 answer
178 views

As per security recommendations, I have removed Pragma settings from our site (Angular JS and ASP.Net), however, I still see it in the response headers, could be that the framework is adding it by ...
Rolando F's user avatar
  • 196
2 votes
1 answer
153 views

Background Note: This is not important for the question I have some macros that act as slightly more general version of attributes, that I attach to functions. Depending on the compiler and compiler ...
Anon's user avatar
  • 381
1 vote
1 answer
88 views

I've been using Getopt::Long and at one point in the code, where I think it should warn(), it doesn't, unless I run with -w. Upon inspection, the (Getopt::Long) code directly checks the value of $^W. ...
Erik Bennett's user avatar
  • 1,101
0 votes
1 answer
132 views

#pragma GCC diagnostic push #pragma GCC diagnostic ignore ??? int fstat(int handle, struct stat *statbuf); /* to get struct stat, #include <asm/stat.h> */ #pragma GCC diagnostic pop I've ...
Joshua's user avatar
  • 43.6k
1 vote
2 answers
100 views

I just know that #pragma once is not part of the C standard but rather part of the preprocessor. In that case, does that make the preprocessor not part of the C standard? So, are the C programming ...
jaroenchoke's user avatar
1 vote
1 answer
59 views

// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract BankAccount { uint private balance; // Deposit function: adds an amount to the balance function deposit(uint amount) ...
JabirPapa's user avatar
0 votes
0 answers
122 views

For the two pragmas #pragma fenv_access (on) #pragma STDC FENV_ACCESS ON Does it matter I put them before of after #include headers? Looks to me both are fine? Why GCC does not support "#pragma ...
JS0's user avatar
  • 99
0 votes
1 answer
74 views

clang compiler struct packing - always padded to 2bytes Short: I'm unable to get my clang compiler to pack the packed_struct_test test struct in lwip to 5 bytes. It always shows 6bytes. Details: Here'...
G. B.'s user avatar
  • 632
1 vote
1 answer
99 views

In Xcode, I want to find out the value of the STDC FP_CONTRACT pragma after including just float.h and math.h. To my surprise, I couldn't find any way to do it! So the question: Am I just missing ...
gnasher729's user avatar
1 vote
0 answers
415 views

I'm using AVX2 instruction to initialize static inline variables in my code. But the following does not compile. #pragma GCC target("avx2") #include <iostream> #include <immintrin.h&...
Soumyadeep Dash's user avatar
2 votes
0 answers
133 views

My goal is to remove name from SECTION_STOP in the following macros: // Start creates the object #define SECTION_START(name, ...) \ auto section_##name = create_section_name(#name, ## __VA_ARGS__); ...
Kron's user avatar
  • 193
-2 votes
2 answers
2k views

Using GCC on Linux (Mint) I have a line of code ... #pragma message "blah blah blah" When I run GCC I get this output with no warning, errors, etc ... src/source_file.c:29:9: note: ‘#...
IAbstract's user avatar
  • 19.9k
0 votes
1 answer
931 views

I am working w/ Maui XAML, but I would like to disable this XAML warning on a single file (ok maybe a few ;)). XamlC XC0022 warning : Binding could be compiled if x:DataType is specified. In C# I ...
kenny's user avatar
  • 22.6k
2 votes
2 answers
195 views

I would simply like to spawn a background thread, like std::thread, but just with OpenMP. Is this possible? If yes, how ist it done? To better explain what I want to achieve, here the C++ Code of what ...
martin7743's user avatar
0 votes
0 answers
106 views

If I declare an external function in a C source file compiled with bcc32.exe (Borland C++ compiler, tested with the free version 5.5.1), it prepends an _ in the .obj file, for example, extern int ...
pts's user avatar
  • 88.7k
0 votes
0 answers
257 views

I know there is use case scenario for '#pragma once' in classic .h headers containing only declarations. But I wonder: what about .hpp files which most of the time contain many definitions. Should I ...
LRetro's user avatar
  • 61
0 votes
1 answer
144 views

I have this code, but I need help to use OpenMP #pragmas to increase its speed. I want to parallelize the for loops over variables i and j. The values of n and m can be much larger, too. For example,...
Vladimir Pugovkin's user avatar
3 votes
1 answer
131 views

I've migrated our Visual Studio C++ project to Cpp20, and it's compiling fine except at a couple of places where some non-compliant library is called. The library defines macros like this: #define ...
digory doo's user avatar
  • 2,337
0 votes
2 answers
63 views

Assume the following simple structure in C: struct entry { int id; const char *name; }; Nothing special. Say I'd like to initialise an array of members globally. One would do: const static ...
rralf's user avatar
  • 1,250
0 votes
1 answer
308 views

On MSVC I can issue compilation-time message like so: #pragma message("...some compilation-time message...") Is there an equivalent in GCC?
PazO's user avatar
  • 1,486
1 vote
0 answers
66 views

#pragma comment(lib, ...) can be quite useful to declare library dependencies (static or import) from within a translation unit. As far as I am aware the way #pragma comment(lib, ...) works is by ...
0xC0000022L's user avatar
  • 21.3k
0 votes
1 answer
60 views

I would increase speedup of these code with OpenMP. for (i = 1; i < length; i++) { for (j = 1; j < i; j++) sum_c += c[j]; c[i] = sum_c + W[i]; sum_c = 0; } I try with these ...
kilerin's user avatar
0 votes
2 answers
118 views

Currently, I have the following piece of code: enum class Letters { A, B, C }; #pragma GCC diagnostic push #pragma GCC diagnostic error "-Wswitch" Letters e(Letters::A);...
neutrion's user avatar
0 votes
1 answer
91 views

I want my program to show the console window if it detects the solution configuration is debug. If it detects release, then the console window should not show up #include "Window.h" int ...
Foryxled_Dev's user avatar
0 votes
1 answer
242 views

Usually, I can disable an annoying warning by wrapping two pragma warning disable statements around it. For instance: #pragma warning disable IDE0060 public static int MultiplyByZero(int Number) =&...
Brendan Lynn's user avatar
4 votes
1 answer
844 views

During the hackathon ETH Global Paris Was attempting to integrate a circom circuit with hashing a birthday date to prove that the user know the date following a well known medium tutorial. Here is its ...
Pavel Fedotov's user avatar
1 vote
1 answer
379 views

I am not sure where I saw it first, but I got used to using #pragma region region name and #pragma endregion to mark sections in class definitions that belong together, like operator implementations. ...
Tomáš Zato's user avatar
0 votes
1 answer
354 views

Lets say we have project wide optimisation disabled (eg -O0) for my project and I did the following. Edit: I am using tricore-gcc (should be the same as normal GCC). There is no documentation I can ...
rollsch's user avatar
  • 2,810
1 vote
1 answer
2k views

I am a competitive programmer and I use pragmas for my codes. The pragmas that I use are: #pragma GCC optimize("O3") #pragma GCC optimization("Ofast,unroll-loops") #pragma GCC ...
MELTFREEZE's user avatar
1 vote
0 answers
401 views

I'm trying to fold elements in an array with #pragma region and #pragma endregion directives, but every time I compile it I get: gcc -ffreestanding -fshort-wchar -fno-stack-protector -Wall -Wno-...
somecollagist's user avatar
1 vote
1 answer
137 views

I've encountered some code like this: void _Pragma("function") f() { int i = 0; _Pragma("loop"); while (i < 100) { ... } } GCC compiles it without issues. But I don'...
anol's user avatar
  • 9,400
-1 votes
1 answer
105 views

I am lerning how to use OpenMP to make a code use muttiple processors. Recently, I tried to make my Ewald Summation Fourier part parallel using OpenMP. Below is the function named ...
Seth's user avatar
  • 3
1 vote
1 answer
390 views

I have been working on cleaning up warnings on pedantic code, and we treat warnings as errors. I have interface code between Ada and C++, which looks like this: Ada manager.ads: function Foo(ID_Type : ...
Brinck's user avatar
  • 69
5 votes
1 answer
1k views

I have some comments that have some macro examples. To make them more readable, I end the line with a \ to continue the macro on the next line. I'd rather not put a space after the \ to remove the ...
Adrian's user avatar
  • 11.1k
2 votes
2 answers
292 views

I am trying to understand one line of code having two __pragma operatores inside one define macro: #define NULL (_Pragma("nomisrac 10.5") 0 _Pragma("nomisrac restore")) I know ...
Zimo93's user avatar
  • 31
1 vote
2 answers
361 views

I have a legacy logging printf-like function in C: namespace legacy { void DoLog(const char* format,...); } If is only visible if a corresponding macro is defined (this is legacy too): #ifdef LOG ...
DumbStudent2016's user avatar
2 votes
0 answers
236 views

I have a C# project defining a symbol named WIN: <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <DefineConstants>$(DefineConstants);WIN</...
Starnuto di topo's user avatar
-1 votes
1 answer
219 views

is it possible to for example use #pragma to raise a custom warning within the VS IDE? I'd need it for a while because there are two classes in this code that contain the very same data but derive ...
CarstenP's user avatar
  • 241
1 vote
0 answers
233 views

This is the first part of my code and I can't understand the mistake written at the end of the message. Maybe I don't know enough to understand it. I would be very grateful if someone can explain me ...
Ernestina Lede's user avatar
2 votes
1 answer
892 views

I am struggling to get my twin.macro setup working in my React app. I cannot provide an entire history of what I've tried, since I have tried dozens of different things, but I will outline my current ...
serlingpa's user avatar
  • 12.8k
0 votes
0 answers
55 views

#include<stdio.h> #include<omp.h> #include<stdlib.h> float FloatRandomizer(float a, float b) { float randomNumber = (a + (float)rand() / (float)(RAND_MAX / b)); if (...
Good guy from world's user avatar

1
2 3 4 5
16