Thread: Problem defining Structure of array, getting warning: missing initializer for member

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    6

    Question Problem defining Structure of array, getting warning: missing initializer for member

    Code:
    struct iltInitStruct pc_init_struct[] = {
                IL("_simPinCheckForInst", _simPinCheckForInstC, 7, 7, "ttttttt"),
                IL("_simGetMismatchReason", _simGetMismatchReasonC, 0, 0, "ttttttt"),
                IL("_simStartPinCheck", _simStartPinCheckC, 0, 0, "ttttttt"),
                IL("_simStopPinCheck", _simStopPinCheckC, 0, 0, "ttttttt"),
                IL("_simSetDebugPC", _simSetDebugPCC, 1, 1, "x"),
                IL("_simGetDebugPC", _simGetDebugPCC, 0, 0, "x"),
                //IL(0,0,0,0,0)
                {{0}} /* MUST BE LAST */
    };
    whats wrong with the above declaration?

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    shouldn't that be

    Code:
    struct iltInitStruct pc_init_struct[] = {
                {"_simPinCheckForInst", _simPinCheckForInstC, 7, 7, "ttttttt"},
                {"_simGetMismatchReason", _simGetMismatchReasonC, 0, 0, "ttttttt"},
                {"_simStartPinCheck", _simStartPinCheckC, 0, 0, "ttttttt"},
                {"_simStopPinCheck", _simStopPinCheckC, 0, 0, "ttttttt"},
                {"_simSetDebugPC", _simSetDebugPCC, 1, 1, "x"},
                {"_simGetDebugPC", _simGetDebugPCC, 0, 0, "x"},
                //IL(0,0,0,0,0)
                {{0}} /* MUST BE LAST */
    };
    Although i haven't seen yet the structure definiation yet.

    ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    6
    Quote Originally Posted by ssharish2005 View Post
    shouldn't that be

    Code:
    struct iltInitStruct pc_init_struct[] = {
                {"_simPinCheckForInst", _simPinCheckForInstC, 7, 7, "ttttttt"},
                {"_simGetMismatchReason", _simGetMismatchReasonC, 0, 0, "ttttttt"},
                {"_simStartPinCheck", _simStartPinCheckC, 0, 0, "ttttttt"},
                {"_simStopPinCheck", _simStopPinCheckC, 0, 0, "ttttttt"},
                {"_simSetDebugPC", _simSetDebugPCC, 1, 1, "x"},
                {"_simGetDebugPC", _simGetDebugPCC, 0, 0, "x"},
                //IL(0,0,0,0,0)
                {{0}} /* MUST BE LAST */
    };
    Although i haven't seen yet the structure definiation yet.

    ssharish
    No these are functions that are passing certain values

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    You need to go look at what iltInitStruct is defined as, and then look at what the LL macro is defined as.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Constructor Initializer List Problem (New (to me) compiler warning)
    By M.Richard Tober in forum C++ Programming
    Replies: 2
    Last Post: 10-24-2011, 01:47 AM
  2. initialize member array in initializer list?
    By Vick jr in forum C++ Programming
    Replies: 4
    Last Post: 05-20-2010, 06:39 AM
  3. warning: excess elements in array initializer
    By redruby147 in forum C Programming
    Replies: 6
    Last Post: 09-30-2009, 06:08 AM
  4. Replies: 10
    Last Post: 08-27-2009, 09:58 AM
  5. How do I check for a specific missing structure member?
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 03-13-2002, 02:46 PM