Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FATFS / IAR compilation issue Pe029 #11259

Merged
merged 2 commits into from Aug 23, 2019

Conversation

@JanneKiiskila
Copy link
Contributor

commented Aug 19, 2019

IAR / FATFS - Pe029 error

IAR compilation fails at _fs = { 0 }; due to

[Error] FATFileSystem.cpp@285,0: [Pe029]: expected an expression

Changing that initializer fixes the issue. IAR is more sensitive
in C/C++ being mixed together than other compilers.

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@0xc0170 @kjbracey-arm @michalpasztamobica

@ciarmcom ciarmcom requested review from 0xc0170, kjbracey-arm, michalpasztamobica and ARMmbed/mbed-os-maintainers Aug 19, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Aug 19, 2019

@kjbracey-arm
Copy link
Contributor

left a comment

I'm not actually sure why IAR is rejecting this. Seems like it should be legal to me (after 20 minutes of staring at cppreference).

But it's crummy code anyway, and the memset is worse.

Instead, please get rid of the assignment in the body, and just add _fs() to the member initialiser list. That will clear it out nicely.

@0xc0170 0xc0170 added needs: work and removed needs: review labels Aug 20, 2019

@kjbracey-arm

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2019

BTW, which version of IAR are you using, and why isn't this showing up in some CI?

IAR / FATFS - Pe029 error
IAR compilation fails at `_fs = { 0 };` due to

```
[Error] FATFileSystem.cpp@285,0: [Pe029]: expected an expression
```

Changing that object initializer list instead, as that seems
to pass IAR compilation, too.

Changed original memset to object initialiser list based on review
feedback from Kevin Bracey.

@JanneKiiskila JanneKiiskila force-pushed the JanneKiiskila:fatfs-iar branch from 84cf24f to f149b4c Aug 22, 2019

@JanneKiiskila

This comment has been minimized.

Copy link
Contributor Author

commented Aug 22, 2019

This is actually showing up on Client CI, hence the PR. Rebased, force pushed and changed the memset to initializer list implementation as per your feedback (very valid one).

@kjbracey-arm
Copy link
Contributor

left a comment

Really should have been caught in Mbed OS pull CI before it hit master.

@JanneKiiskila

This comment has been minimized.

Copy link
Contributor Author

commented Aug 22, 2019

Fully agree on that.

@JanneKiiskila

This comment has been minimized.

Copy link
Contributor Author

commented Aug 22, 2019

Seems different IAR versions behave differently here, IAR 8.32 seems to compile even w/o this fix, but an older one - fails.

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Aug 22, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

commented Aug 22, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@kjbracey-arm

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

Seems different IAR versions behave differently here, IAR 8.32 seems to compile even w/o this fix, but an older one - fails.

Then I reckon it was a now-fixed compiler bug. The code seemed valid.

@0xc0170 0xc0170 merged commit c4711c1 into ARMmbed:master Aug 23, 2019

25 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8623 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8464B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details

@JanneKiiskila JanneKiiskila deleted the JanneKiiskila:fatfs-iar branch Sep 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.