Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Maarten Brock
04/13/17 11:59
Read: 591 times
The Netherlands

#190777 - two problems
Responding to: Michael Karas's previous message
Balasubramanian Vaidhyana said:
int index;

for (index=0;index<10000000L;index++)

This code has two problems:
1) 10000000L does not fit in an int and thus index will overflow earlier and the comparison is always true.
2) A C compiler is allowed to remove any code that has no side effects and thus this loop could be optimized out.

List of 7 messages in thread
GPIO pin toggle on TUSB3410      Balasubramanian Vaidhyana      03/13/17 08:57      
   Short Pulse      Michael Karas      03/16/17 06:05      
      GPIO working      Balasubramanian Vaidhyana      03/16/17 11:28      
         Was it?      Michael Karas      03/18/17 12:47      
            GPIO toggle      Balasubramanian Vaidhyana      03/20/17 07:00      
               Good to hear      Michael Karas      03/25/17 19:40      
                  two problems      Maarten Brock      04/13/17 11:59      

Back to Subject List