# More warnings with -Wconversion!

**URL:** https://forum.juce.com/t/more-warnings-with-wconversion/14466
**Category:** General JUCE discussion
**Created:** [March 15, 2015, 2:44pm UTC](https://forum.juce.com/t/more-warnings-with-wconversion/14466 "2015-03-15T14:44:45Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)
#### Post date: [March 15, 2015, 2:44pm UTC](https://forum.juce.com/t/more-warnings-with-wconversion/14466/1 "2015-03-15T14:44:45Z")

</div>

Since implicit conversion warnings are not 'on' by default&nbsp;in GCC or Clang, and not part of -Wall, I decided to give it a shot.

It worked out great for my code, and gave me all the same implicit conversion warnings Visual Studio does... and more!

This flag seems more strict and thorough&nbsp;than VS, and pointed out a wad&nbsp;of conversions in JUCE. There are some fishy ones, like passing signed integers (which may be set to -1 by JUCE)&nbsp;to OpenGL functions that support only unsigned integers.

Note that I'm testing using the Demo.

Example:

```
openGLContext.extensions.glVertexAttribPointer (position->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), 0);
```

Where _attributeID_ is a _GLint_, and&nbsp;_glVertexAttribPointer()_ takes a&nbsp;_GLuint_ for first parameter. The same applies to&nbsp;_glEnableVertexAttribArray()_, too...

The JUCE docs say that _attributeID_ will be \<0 if the uniform could not be found; this seems like the potential for bizarre run-time issues...

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)
#### Post date: [March 15, 2015, 6:11pm UTC](https://forum.juce.com/t/more-warnings-with-wconversion/14466/2 "2015-03-15T18:11:36Z")

</div>

Ah, thanks.. I thought I'd already nailed all of those, but I guess the projects in which I've enabled that flag don't include modules like openGL, so I've missed a few warnings. Will skip through and sort that out!

---

<div class="post-metadata">

### Author: ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)
#### Post date: [March 15, 2015, 10:38pm UTC](https://forum.juce.com/t/more-warnings-with-wconversion/14466/3 "2015-03-15T22:38:22Z")

</div>

Using the tip… just a few left…

![](https://www.platinumsamples.com/public/juce/Wconversion.png)

Let me know if you need line numbers, but I think the file names should indicate the modules.

Cheers,

Rail

---

<div class="post-metadata">

### Author: ![mayae](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@mayae](https://forum.juce.com/u/mayae)
#### Post date: [March 15, 2015, 11:35pm UTC](https://forum.juce.com/t/more-warnings-with-wconversion/14466/4 "2015-03-15T23:35:14Z")

</div>

Have you tried the vs 2015 compiler preview? It generates a lot of new warnings. Most are just cases where local names&nbsp;hides globals / members, but there are a couple of cases with inconsistent alignment specifications, unsafe functions and at one point I saw a&nbsp;place with an apparantly unavoidable recursion, but can't trace it currently..

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)
#### Post date: [March 16, 2015, 1:10pm UTC](https://forum.juce.com/t/more-warnings-with-wconversion/14466/5 "2015-03-16T13:10:01Z")

</div>

I can't see those warnings at all (?)

I've definitely been building those files with -Wconversion, so not sure why you'd see them and I don't..&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)
#### Post date: [March 16, 2015, 4:48pm UTC](https://forum.juce.com/t/more-warnings-with-wconversion/14466/6 "2015-03-16T16:48:00Z")

</div>

You must be using a Base SDK of 10.10 – I’m using an earlier base.

Cheers,

Rail
