How are GLfloat supposed to be initialized? Using floats/doubles or explicit casting?

How are GLfloat supposed to be initialized? Using floats/doubles or explicit casting?

Particularly, I have the following code:

GLfloat diffColors[4][4] = { { 0.5, 0.5, 0.9, 1.0 },
	{ 0.9, 0.5, 0.5, 1.0 },
	{ 0.5, 0.9, 0.3, 1.0 },
	{ 0.3, 0.8, 0.9, 1.0 } };

which I think used to work, but now the compiler gives

error C2397: conversion from 'double' to 'GLfloat' requires a narrowing conversion

Welcome to C++11. This is a breaking change in the standard; the use of braces to initialize things used to be able to lose information due to implicit conversions. Now, they’re not.

Of course, you don’t really care in this case, so it’s kind of pointless. But the solution is to suffix all of your floating-point literals with f. That will make them actual floats.