CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2018
    Posts
    159

    Osx and Gnu C++ compiler

    The same program .cpp has been compiled into OSX without errors, It run but in assignment among variables got segmentation fault 11 while behaviour is different in Linux environment (It has been compiled in the same way) that It works fine.
    Can you give me suggestions please ?

  2. #2
    Join Date
    Nov 2018
    Posts
    137

    Re: Osx and Gnu C++ compiler

    Success on one platform doesn't mean your code is good.

    It just means you stopped debugging it when it stopped crashing (and gave you plausible answers), not when it was bug-free.

    Running on another platform just flushed out a few more bugs.

    Try compiling it with flags g++ -Wall -Wextra -g -fsanitize=address

    If you've never done any of this, expect a lot of messages.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured