I'll just add my vote: +1 to supporting the intersection of C99, C11,
C++11, and later standards.
Also +1 to sadness that VLAs don't fall into there. (Though I understand
the reasons why compiler developers might not want to support them.)
--Richard
On 3/11/20 8:34 AM, Jed Brown wrote:
My
Lisandro Dalcin writes:
> PS: BTW, if you use typeof() [*], you can simplify these VLA declarations:
>
> double (*a)[m][n] = (typeof(a)) p;
> a[i][j][k] = 42;
>
> [*] Don't remember if it is part of C99 or up
typeof isn't in any standard, including proposed (-std=c2x). You can
use __typeof as
On Wed, 11 Mar 2020 at 18:34, Jed Brown wrote:
> My proposal is for PETSc to support the intersection of C99, C11, C++11,
> and any later standards. This (sadly*) excludes VLA.
>
> [*] I don't care about stack allocation, but VLA-pointers are extremely
> useful for multi-dimensional array
My proposal is for PETSc to support the intersection of C99, C11, C++11,
and any later standards. This (sadly*) excludes VLA.
[*] I don't care about stack allocation, but VLA-pointers are extremely
useful for multi-dimensional array indexing. I'm sad that C11 made that
optional.
Jeff Hammond
I wonder if it is not more useful to talk in terms of C11 features. Unlike
C99, C11 makes VLAs optional via __STDC_NO_VLA__, so you have a
standardized way of expressing the subset of C11 that is compatible with
C++11. __STDC_NO_ATOMICS__ and __STDC_NO_THREADS__ play a similar role.
Of course,
On Sat, 7 Mar 2020 at 08:48, Jed Brown wrote:
> I have a question for petsc-dev: Do you know anyone who needs to build
> PETSc with a compiler that doesn't support variadic macros and for-loop
> declarations? (Both of these are in C99 and C++11, and supported by all
> tested configurations
On Sat, Mar 7, 2020 at 8:45 AM Jed Brown wrote:
> Satish Balay writes:
>
> > On Fri, 6 Mar 2020, Jed Brown wrote:
> >> PetscInt some,several,variables;
> >>
> >> // code
> >> if (PetscDefined(HAVE_MAGIC)) {
> >> function(several,);
> >> }
> >> use(some,variables);
> >
> > One
On Sat, 7 Mar 2020, Jed Brown wrote:
> Satish Balay writes:
>
> > On Fri, 6 Mar 2020, Jed Brown wrote:
> >> PetscInt some,several,variables;
> >>
> >> // code
> >> if (PetscDefined(HAVE_MAGIC)) {
> >> function(several,);
> >> }
> >> use(some,variables);
> >
> > One minor issue:
Satish Balay writes:
>> +1 for the for-loop declarations.
>>
>> No more need to police the use of // C++-style comments?
>
> I think the objection was more about the code style. Mixing both types of
> comments does not look good.
I don't have a problem with // for one-line comments and /* */
Satish Balay writes:
> On Fri, 6 Mar 2020, Jed Brown wrote:
>> PetscInt some,several,variables;
>>
>> // code
>> if (PetscDefined(HAVE_MAGIC)) {
>> function(several,);
>> }
>> use(some,variables);
>
> One minor issue: we haven't yet fixed up clang analyzer build. Likely this
>
On Sat, 7 Mar 2020, Patrick Sanan wrote:
> Perhaps naively, I‘d assume that while there may well be someone out there
> relying on compilers for which this would be a problem, that same person is
> also less likely to be able to upgrade PETSc.
>
> The benefits seem well worth it. It‘ll make
On Fri, 6 Mar 2020, Jed Brown wrote:
> I have a question for petsc-dev: Do you know anyone who needs to build
> PETSc with a compiler that doesn't support variadic macros and for-loop
> declarations? (Both of these are in C99 and C++11, and supported by all
> tested configurations including
Perhaps naively, I‘d assume that while there may well be someone out there
relying on compilers for which this would be a problem, that same person is
also less likely to be able to upgrade PETSc.
The benefits seem well worth it. It‘ll make things just that much easier to
work with.
+1 for the
I have a question for petsc-dev: Do you know anyone who needs to build
PETSc with a compiler that doesn't support variadic macros and for-loop
declarations? (Both of these are in C99 and C++11, and supported by all
tested configurations including compilers that don't fully implement
these
14 matches
Mail list logo