Re: Some questions related PR#1478

2020-07-31 Thread Nathan Hartman
On Fri, Jul 31, 2020 at 1:42 PM Gregory Nutt wrote: > > > Before we change the coding standard, I suggest that we get more > > feedback from the dev community. > > > > My opinion: If a loop does not require a body, I suggest to use > > braces, rather than a semicolon, because it is less prone to

Re: Some questions related PR#1478

2020-07-31 Thread Gregory Nutt
Before we change the coding standard, I suggest that we get more feedback from the dev community. My opinion: If a loop does not require a body, I suggest to use braces, rather than a semicolon, because it is less prone to programmer error. ... I should not be so opposed to coding standard ch

Re: Some questions related PR#1478

2020-07-31 Thread Schock, Johannes - NIVUS GmbH
As a conclusion for me: If you don't want to force braces, the macos/sim build test needs to be fixed. Importantly: It's not a style test that is failing, it's a build test. Nevertheless I will change the code in my PR to use braces, because it seems to be the preferred way (at least by Greg and N

Re: Some questions related PR#1478

2020-07-31 Thread Gregory Nutt
My opinion: If a loop does not require a body, I suggest to use braces, rather than a semicolon, because it is less prone to programmer error. I would be okay with either: while (condition) { } or while (condition) {} And of the two, I think the second one expresses the intent best.

Re: Some questions related PR#1478

2020-07-31 Thread Nathan Hartman
On Fri, Jul 31, 2020 at 10:55 AM Gregory Nutt wrote: > > Hmmm... I don't agree. > > > > The Coding Standard encourages empty "while loops": > > https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#while > > Why should this not applicable for "for loops"? I think there are many > > al

Re: Some questions related PR#1478

2020-07-31 Thread Gregory Nutt
Hmmm... I don't agree. The Coding Standard encourages empty "while loops": https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#while Why should this not applicable for "for loops"? I think there are many already in the tree. Actually, I think that is an error in the coding docum

Re: Some questions related PR#1478

2020-07-31 Thread Schock, Johannes - NIVUS GmbH
ild / macOS (sim)" complaining? Johannes > -Original Message- > From: Nathan Hartman [mailto:hartman.nat...@gmail.com] > Sent: Friday, July 31, 2020 4:15 PM > To: dev@nuttx.apache.org > Subject: [!!Mass Mail]Re: Some questions related PR#1478 > > On Fri, Jul 31, 2020 a

Re: Some questions related PR#1478

2020-07-31 Thread Nathan Hartman
On Fri, Jul 31, 2020 at 9:46 AM Schock, Johannes - NIVUS GmbH < johannes.sch...@nivus.com> wrote: > Hello, > I have two questions related PR#1478 ( > https://github.com/apache/incubator-nuttx/pull/1478): > > 1. I think there's a configuration error with "Build / macOS (sim)" since > it is using -W

RE: Some questions related PR#1478

2020-07-31 Thread Schock, Johannes - NIVUS GmbH
> From: Gregory Nutt [mailto:spudan...@gmail.com] > fsync on any open file descriptor will flush the file system since data > is only buffered for for metadata and one file at a time. This explains why my problem seems gone after I introduced a fsync on the file in my test case. I will have anoth

Re: Some questions related PR#1478

2020-07-31 Thread Gregory Nutt
2. Is there a way to flush a fat file system? Because I think the unexpected behaviour I've seen was related to debugging and fat cache flush. I tried to use fsync on the folder (which was proposed in a linux related discussion), but open on a folder returns errno 21 (is a directory). fsync o