Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:39:50+00:00 2026-06-14T20:39:50+00:00

void init(void) { glClearColor ((float)0.0, (float)0.0, (float)0.0, (float)0.0); glShadeModel (GL_FLAT); } The parameter of

  • 0
void init(void) 
{
   glClearColor ((float)0.0, (float)0.0, (float)0.0, (float)0.0);
   glShadeModel (GL_FLAT);
}

The parameter of glClearColor is float. But the gcc always give a warning:

main.c: In function ‘init’:
main.c:12: warning: passing argument 1 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype
main.c:12: warning: passing argument 2 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype
main.c:12: warning: passing argument 3 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype
main.c:12: warning: passing argument 4 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype 

But i just convert a digit to float, not double, can’t figure out why.

My os is mac os 64bit and the following is the makefile.

UNAME := $(shell uname)

ifeq ($(UNAME), Darwin)
    CFLAG := -framework GLUT -framework OpenGL -g -Wall -Wconversion
else
    CFLAG := -lm -lglut -lGL -lGLU -g -Wall
endif

PUB_SRC := util.c plane.c dot.c linked_dots.c controller.c time_data.c
SRC := main.c $(PUB_SRC)
TEST_SRC := test.c $(PUB_SRC)

.PHONY : main
main: $(SRC)
    gcc $(CFLAG) $(SRC)

.PHONY : test
test: $(TEST_SRC)
    gcc $(CFLAG) $(TEST_SRC)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:39:51+00:00Added an answer on June 14, 2026 at 8:39 pm

    I take it you’re using GCC 3.x? In GCC 3.x, the -Wconversion flag is documented as follows:

    Warn if a prototype causes a type conversion that is different from what
    would happen to the same argument in the absence of a prototype. This
    includes conversions of fixed point to floating and vice versa, and
    conversions changing the width or signedness of a fixed point argument
    except when the same as the default promotion.

    Also, warn if a negative integer constant expression is implicitly
    converted to an unsigned type. For example, warn about the assignment
    x = -1 if x is unsigned. But do not warn about explicit
    casts like (unsigned) -1.

    [link]

    From what I understand, the original purpose of this flag was to help detect potential problems when migrating from traditional C to ANSI C, and cases where adding a prototype could cause problems. (To be honest, it seems to me like it would have been more meaningful for the prototype itself to trigger a warning, rather than a use of the function, but there’s probably some use I’m missing.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Init(); backthread tr=new backthread(); tr.execute(0,0,0); } backthread
Trying to add init parameter names to a list in init(ServletConfig) method. public void
void init (void) { glClearColor (1.0, 1.0, 1.0, 0.0); //glMatrixMode(GL_MODELVIEW); //gluLookAt(x0, y0, z0, xref,
void init(void) { glEnable(GL_DEPTH_TEST); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); } void display(void) { glClearColor(1.0, 1.0, 1.0, 1.0);
#include <GL/gl.h> #include <GL/glut.h> void display(); void init(); int main(int argc, char* argv[]) {
I try to run the following code: public void Init(Url rootUrl) { var web
-(void) readProductsFromDatabase { // Setup the database object sqlite3 *database; // Init the animals
here is my code public class SimpleJoglApp extends JFrame { public static void main(String[]
class Board { public: virtual void init() = 0; virtual void print_board() const =
I'm trying to implement the flood fill algorithm. But glReadPixels() is returning float RGB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.