Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
2 votes
2 answers
122 views

I'm asking this question from the perspective of a compiler developer – I want to know whether a particular potential optimisation is valid (because all programs that the optimisation would break have ...
Advice
0 votes
3 replies
104 views

I'm in C and I have an int ** (2 dimensional array, it's basically a matrix, it's actually set up a little bit complicated but there's no internal aliasing, so it's not relevant). is this int** ...
2 votes
3 answers
200 views

size_t hash(char const[restrict static 32]) [[reproducible]]; This is a function definition from Modern C by Jens Gustedt. I understand that this is a more preferred alternate notation to a 32 char ...
0 votes
0 answers
92 views

I am aware that __restrict__ is not standard C++ and is instead an extension of C99 that GCC supports (previous question of mine: Uncertainty of GCC __restrict__ rules) However, if we make some ...
3 votes
1 answer
146 views

I’m trying to understand the nuances of the restrict keyword in C, particularly how its behavior might differ when applied to a pointer to a structure versus a pointer to a primitive type like int. ...
3 votes
3 answers
140 views

My understanding of restrict qualified pointers in that no restrict qualified pointer may point to the same memory address as another pointer if both pointers are accessible within the same scope. (...
1 vote
2 answers
240 views

We use extern "C" { ... } to include C header files in C++. This does not seem to work if the C file uses C99 keywords such as restrict. For example: test.h #ifndef TEST_H #define TEST_H ...
5 votes
1 answer
206 views

Is the following valid usage of restrict qualifier in C or undefined behaviour? #include <stdio.h> int foo(float * restrict a) { float a1 = *a; float a2 = *(a+1); float * restrict ...
4 votes
1 answer
126 views

I was thinking about the utility of non-standard __restrict keyword in C and C++ and how its effect can be emulated by carefully declare (disjoint) value objects . Restrict is usually explained ...
alfC's user avatar
  • 16.8k
1 vote
1 answer
123 views

2011 6.7.3.1 says: 1 Let D be a declaration of an ordinary identifier that provides a means of designating an object P as a restrict-qualified pointer to type T. 2 If D appears inside a block and ...
0 votes
0 answers
77 views

I am writing some C++ code and compiling with g++. I use the __restrict__ keyword on pointer arrays in some performance critical places to hopefully get better performance. std::vector::operator[] has ...
6 votes
1 answer
96 views

Is the C restrict keyword/qualifier transitive through multiple levels of pointer indirection? For instance, given the following snippet: struct Bar { int b; }; struct Foo { struct Bar* bar; }...
1 vote
1 answer
111 views

In Modern C, Jens Gustedt states that: With the exclusion of character types, only pointers of the same base type may alias. But then I find this declaration of fgetpos() in Annex B of the C ...
3 votes
2 answers
257 views

Consider this code: extern int A[2]; /* Just returns `p` back. */ extern int *identity(int *p); int f(int *restrict p) { int *q = identity(p); /* `q` becomes "based on" `p` */ int ...
1 vote
0 answers
66 views

If I have an aliasing T *restrict, but it is never used, is this considered undefined-behavior. Or is undefined behavior at the point of use. For example int *nothing = NULL; int *restrict ...
doliphin's user avatar
  • 1,044

15 30 50 per page
1
2 3 4 5
...
11

AltStyle によって変換されたページ (->オリジナル) /