Possible switch/case bug

new topic     » topic index » view thread      » older message » newer message

The following code 'works' when interpreted, but generates a duplicate case value error if compiled with gcc.
It should generates a duplicate case value error when interpreted, or am I missing something.
I also noticed that the last 'case' will trigger, regardless which 'case' comes first. Should it not trigger the first case?

include std/console.e 
 
constant min = 1 
constant max = 1 
 
integer test = min 
 
switch test do 
	case min then 
		printf(1,"Min = %d",min) 
	case max then 
		printf(1,"Max = %d",max) 
end switch 
 
wait_key() 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu