This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
From Moshe Milshtein ===================================== I am using NetBeans 8.2 in Ubuntu 17.04 with gcc 6.3.0. I created a C project with the following code in main.c: #include <stdio.h> int main(void) { double x; for (x = 0.0; x <= 5.0; x += 0.1) printf("%f %f\n", x, x); } When running the project the loop is halting. Here is the end of the output that I see in the run window: 4.300000 4.300000 4.400000 4.400000 4.500000 4.500000 4.600000 4.600000 4.700000 RUN FINISHED; exit value 0; real time: 0ms; user: 0ms; system: 0ms If I open a terminal window and build the same source with "gcc main.c" the program gives the expected result, looping until 5.0000000. What's going on? Thanks.
From me =============================== Can you try 2 samples? with delay ================================================= #include <stdio.h> #include <unistd.h> int main() { double x; for (x = 0.0; x <= 5.0; x += 0.1) { printf("%f %f\n", x, x); } sleep(1); return 0; } force a write from buffer to stdout ================================================= #include <stdio.h> int main() { double x; for (x = 0.0; x <= 5.0; x += 0.1) { printf("%f %f\n", x, x); } fflush(stdout); return 0; }
From Moshe Milshtein ===================================== Flushing or closing stdout does not help. My locale is en_US.UTF-8. Adding a delay after the loop with sleep(1) (as suggested by soldatov) solves the problem.
Link to e-mail thread: https://netbeans.org/projects/cnd/lists/users/archive/2017-09/message/17
Hm. I can reproduce this bug in NetBeans 8.2 patch 2, but original NetBeans 8.2 works nicely.
I see stable bug in NetBeans 8.2 patch 2 and NetBeans 8.2 original if I uses such code (50.0 instead of 5.0): #include <stdio.h> int main() { double x; for (x = 0.0; x <= 50.0; x += 0.1) { printf("%f %f\n", x, x); } return 0; }