LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-28-2009, 02:18 AM   #1
kk2202
LQ Newbie
 
Registered: Jan 2009
Posts: 24

Rep: Reputation: 15
Switches controlling the code compilation -- How to


Hi,

I had been working on a CPP code for sometime now, without being aware that some parts of its code, especially security related were not being compiled.

Problem was like my product did not work for SSL mode. On analysis, I found that some part of CPP codes inside a switch(ENABLE_SSL_LIBRARY)were not getting compiled at all. And also that this gets set when we do newgrp crypto command on the box.

This left me without lots of doubts. I wanted to understand how these switches work and if this switch was propreitary to my code or something related to Linux.

My questions now are:

1. Switches like the one mentioned above , are they user defined, for my particular code or are they related to Linux/GCC or makefiles?

2.If a user can define such switches to control code compilation, then need to know the concepts/procedures behind it. How is it done ?

Kindly excuse if these are very very basic. But since I could not get proper stuffs on google, I thought I should ask some experts here who could either explain me or point me to appropriate resources (links of articles / tutorials)
 
Old 08-28-2009, 10:18 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
Is that a switch like the C control structure switch? I would guess that the compiler can figure out the value of ENABLE_SSL_LIBRARY at compile time so it decides that some cases of the switch will never be taken and they don't need to be compiled. Hard to say for sure without more context. gcc will warn about such cases if you pass the -Wunreachable-code option to it.

Quote:
And also that this gets set when we do newgrp crypto command on the box.
What does "this" refer to here?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation problem in c++ template code :( lali.p Programming 2 10-13-2008 06:44 PM
D-ITG compilation error - me or the code? baldy3105 Linux - Software 2 12-08-2006 04:47 AM
compilation error - code 2 jhon Programming 2 08-31-2004 01:54 AM
[Pure-ftpd] Debian compilation switches ?? eriov Linux - Newbie 1 01-21-2004 06:43 AM
[Pure-ftpd] Debian compilation switches ?? eriov Linux - Software 2 01-20-2004 12:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration