glsl Expected token ')', found 'identifier' with function mix

I have a Fragment shader that contains:

[...]
float c = texture2D(tex, tc).a;
float alpha = mix(0.0f, 1.0f, c);
gl_FragColor = vec4(1, 1, 1, alpha) * color;


This works fine on my desktop and Nexus 5. However I get an exception while running on a Wiko mobile:

0:22: L0001: Expected token ')', found 'identifier'


Line 22 is the line containing the mix function.

What I'm doing wrong?

• You seem to be missing a semicolon at the end of the line float c = texture2D... — is that present in the original? It could be that some platforms' shader compilers fix this common error automatically, but the one that's throwing the exception doesn't. – DMGregory Mar 29 '17 at 13:32
• Thanks DMGregory, it was just a mistake when I pasted the code – FloFu Mar 29 '17 at 13:59
• Just by the way, do you have #version directive in the shader? – HolyBlackCat Mar 29 '17 at 14:37
• HolyBlackCat, I have a #version 100 directive – FloFu Mar 29 '17 at 15:02

float alpha = mix(0.0, 1.0, c);