IIRC the C language standard requires that global variables are automatically 
initialized to 0 if not explicitly initialized. Personally I would prefer an 
explicit init to 0 here just for clarity (e.g. to avoid the confusion caused in 
this ticket).

This code obviously depends on the implicit init to 0 of the global variable 
gdb_actual_connections:

https://repo.or.cz/openocd.git/blob/HEAD:/src/server/gdb_server.c#l120

https://repo.or.cz/openocd.git/blob/HEAD:/src/server/gdb_server.c#l1011
https://repo.or.cz/openocd.git/blob/HEAD:/src/server/gdb_server.c#l1041


---

** [tickets:#256] `gdb_actual_connections` is never initialized?**

**Status:** new
**Milestone:** 0.9.0
**Created:** Tue Nov 05, 2019 04:47 PM UTC by Robin Kuzmin
**Last Updated:** Tue Nov 05, 2019 04:47 PM UTC
**Owner:** nobody


Looks like the variable `gdb_actual_connections` is never initialized but is 
read from and affects execution.
`src/server/gdb_server.c: 120`.


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to