Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Driver Uses Variably-Sized Stack Variables #67

Closed
CN-YongJun opened this issue Sep 6, 2019 · 3 comments
Closed

Driver Uses Variably-Sized Stack Variables #67

CN-YongJun opened this issue Sep 6, 2019 · 3 comments
Labels

Comments

@CN-YongJun
Copy link

CN-YongJun commented Sep 6, 2019

image

@CN-YongJun CN-YongJun changed the title sgp30.cbu sgp30.c bug Sep 6, 2019
@CN-YongJun
Copy link
Author

expression must have a constant value.

@abrauchli
Copy link
Contributor

yes, some compilers have an issue with that and we will fix it. For a quick fix you can assume that a buffer of three words will always work.

@@ -90,7 +87,7 @@ static struct sgpc3_data {
 static void unpack_signals(const struct sgp_profile *profile) {
     int16_t i, j;
     uint16_t data_words = profile->num_words;
-    uint16_t word_buf[data_words];
+    uint16_t word_buf[3];
 
     /* copy buffer */
     for (i = 0; i < data_words; i++)

@abrauchli abrauchli changed the title sgp30.c bug Driver Uses Variably-Sized Stack Variables Sep 6, 2019
@abrauchli abrauchli added the bug label Sep 6, 2019
@GetPastTheMonkey
Copy link
Contributor

This should be fixed now (see commit c955989).

@CN-YongJun Could you please check if it works now for you?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants