Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. 不正确的编译 warning
Forum Updated to NodeBB v4.3 + New Features

不正确的编译 warning

Scheduled Pinned Locked Moved Unsolved Chinese
1 Posts 1 Posters 945 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • neemeN Offline
    neemeN Offline
    neeme
    wrote on last edited by
    #1
    QHBoxLayout  *lay;
    
    for(uint i=0;  i<16;  i++)
    {
        if(i%4 == 0)
        {
            lay = new QHBoxLayout;
        }
        lay->addWidget(new QLabel("***"));
    }
    

    /home/neeme/vivere/ocean/Mint/FFreqBus.cpp:25: warning: ‘lay’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    lay->addWidget(f_cur_hz[i]);

    请问怎样调整代码,才能令QT不再产生这样的提示呢? 谢谢!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved