Bug 580600 - -Wmisleading-indentation issue for gcc version less than 6.0
Summary: -Wmisleading-indentation issue for gcc version less than 6.0
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-24 01:57 EDT by Arvid Björkengren CLA
Modified: 2022-08-30 13:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Björkengren CLA 2022-08-24 01:57:37 EDT
Hello Eugene, 

I see the changes by commit
https://git.eclipse.org/c/tcf/org.eclipse.tcf.agent.git/commit/?id=c97a7461028a672574ff7bf51f762b7e91b816c5

and Bug 579274 
https://git.eclipse.org/c/tcf/org.eclipse.tcf.agent.git/commit/agent/tcf/framework/json.c?id=08ada0791f747f327b3ba11f6ded3152285727a3

You could revert these two commits and instead fix the macro causing the warning by adding curly brackets to the while statement inside.


diff --git a/agent/tcf/framework/json.c b/agent/tcf/framework/json.c
index 04e6f6c0..1854fbbc 100644
--- a/agent/tcf/framework/json.c
+++ b/agent/tcf/framework/json.c
@@ -59,7 +59,7 @@
 #define ENCODING_BASE64     1
 
 #define read_no_whitespace(ch, inp)  do { int _c_ = read_stream(inp); \
-    while (_c_ > 0 && isspace(_c_)) _c_ = read_stream(inp); (ch) = _c_; } while (0)
+    while (_c_ > 0 && isspace(_c_)) { _c_ = read_stream(inp); } (ch) = _c_; } while (0)
 
 #define skip_whitespace(inp)  do { int _c_ = peek_stream(inp); \
     while (_c_ > 0 && isspace(_c_)) { read_stream(inp); _c_ = peek_stream(inp); } } while (0)
Comment 1 Eugene Tarassov CLA 2022-08-30 13:38:12 EDT
Fixed.
Thanks!