aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/goto_local_labels.txt
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@kodafritt.se>2024-06-02 21:20:48 +0200
committerSamuel Lidén Borell <samuel@kodafritt.se>2024-06-02 21:20:48 +0200
commit580bf6130632f6855fddeea7b07c8401c56108f2 (patch)
tree4bd5e7cdb68408c52ad8df030f7f887c7d97def0 /notes/goto_local_labels.txt
parentdb73835b12f41be8766384a1cdcc34a0848354dc (diff)
downloadslul-main.tar.gz
slul-main.tar.bz2
slul-main.zip
Notes: Usability, references, numeric types / comparisons, etc.HEADmain
Diffstat (limited to 'notes/goto_local_labels.txt')
-rw-r--r--notes/goto_local_labels.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/notes/goto_local_labels.txt b/notes/goto_local_labels.txt
new file mode 100644
index 0000000..a91cbbe
--- /dev/null
+++ b/notes/goto_local_labels.txt
@@ -0,0 +1,27 @@
+Local goto labels
+=================
+
+This can be used to provide scope for goto labels and avoid accidentally
+jumping to an unrelated block.
+
+Syntax idea (borrowed from the GCC extension):
+
+ func f()
+ {
+ {
+ label skip
+ ...
+ goto skip
+ ...
+ skip:
+ ...
+ }
+ {
+ label skip
+ ...
+ goto skip
+ ...
+ skip:
+ ...
+ }
+ }